Merge branch 'master' into sam460ex

This commit is contained in:
François Revol
2012-12-06 00:12:40 +01:00
121 changed files with 2470 additions and 1136 deletions
+14 -6
View File
@@ -36,8 +36,8 @@ SYSTEM_BIN = "[" addattr base64 basename bash beep cal cat catattr checkfs
zmore znew
;
SYSTEM_APPS = AboutSystem DriveSetup Installer NetworkStatus ProcessController
StyledEdit Terminal
SYSTEM_APPS = AboutSystem ActivityMonitor DriveSetup Installer NetworkStatus
ProcessController StyledEdit Terminal
;
SYSTEM_PREFERENCES = Appearance Backgrounds <preference>Deskbar FileTypes
@@ -45,9 +45,9 @@ SYSTEM_PREFERENCES = Appearance Backgrounds <preference>Deskbar FileTypes
<preference>Tracker VirtualMemory
;
SYSTEM_DEMOS = ;
SYSTEM_DEMOS = Sudoku ;
SYSTEM_LIBS = libbe.so libbnetapi.so libdebug.so libnetwork.so
SYSTEM_LIBS = libbe.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++)
@@ -56,7 +56,7 @@ SYSTEM_LIBS = libbe.so libbnetapi.so libdebug.so libnetwork.so
PRIVATE_SYSTEM_LIBS =
$(HAIKU_JPEG_CURRENT_LIB)
$(HAIKU_LIBPNG_CURRENT_LIB)
$(HAIKU_ZLIB_CURRENT_LIB)
$(HAIKU_ZLIB_CURRENT_LIB)
$(HAIKU_FREETYPE_CURRENT_LIB)
libilmimf.so
;
@@ -195,7 +195,8 @@ AddDirectoryToHaikuImage home mail out ;
AddSymlinkToHaikuImage home config : settings/deskbar : be ;
# Deskbar Application links
AddDirectoryToHaikuImage home config settings deskbar Applications ;
DESKBAR_APPLICATIONS = DriveSetup Installer StyledEdit Terminal ;
DESKBAR_APPLICATIONS = ActivityMonitor DriveSetup Installer StyledEdit
Terminal ;
local linkTarget ;
for linkTarget in $(DESKBAR_APPLICATIONS) {
AddSymlinkToHaikuImage home config settings deskbar Applications
@@ -219,6 +220,13 @@ for linkTarget in $(DESKBAR_PREFERENCES) {
: $(linkTarget) ;
}
# Deskbar Demo links
AddDirectoryToHaikuImage home config settings deskbar Demos ;
for linkTarget in $(SYSTEM_DEMOS) {
AddSymlinkToHaikuImage home config settings deskbar Demos
: /boot/system/demos/$(linkTarget) : $(linkTarget) ;
}
AddSymlinkToHaikuImage system bin : less : more ;
AddSymlinkToHaikuImage system bin : gzip : gunzip ;
AddSymlinkToHaikuImage system bin : gzip : zcat ;
+24 -24
View File
@@ -1,21 +1,21 @@
1 portuguese (brazil) x-vnd.Haiku-DiskProbe 2306672993
File offset: ProbeView Offset do arquivo
File offset: ProbeView Offset do arquivo:
%ld (native) ProbeView %ld (nativo)
64 bit unsigned value: TypeEditors Valor não assinado de 64 bit
Find again ProbeView Localizar de novo
Text FindWindow Texto
Find… ProbeView Localizar...
Case sensitive FindWindow Caso sensitivo
Case sensitive FindWindow Diferenciar maiúsculas e minúsculas
Cancel OpenWindow Cancelar
Close AttributeWindow Fechar
File ProbeView Arquivo
Attribute ProbeView Atributo
Floating-point value: TypeEditors Valor de ponto flutuante
Floating-point value: TypeEditors Valor de ponto flutuante:
16 bit TypeEditors 16 bit
Attributes ProbeView Atributos
Device offset: ProbeView Offset do dispositivo:
Selection ProbeView Seleção
DiskProbe System name DiskProbe
DiskProbe System name Analisador de Disco
what: '%.4s'\n\n TypeEditors 'What' is a message specifier that defines the type of the message. O que é: '%.4s'\n\n
File FileWindow Arquivo
OK DiskProbe OK
@@ -25,56 +25,56 @@ PNG format TypeEditors Formato PNG
Font size ProbeView Tamanho da fonte
Attribute type: ProbeView Tipo de atributo:
Attribute AttributeWindow Atributo
8 bit signed value: TypeEditors Valor assinado de 8 bit
8 bit signed value: TypeEditors valor assinado de 8 bit:
Number: TypeEditors Número:
Save ProbeView Salvar
Stop ProbeView Parar
Number editor TypeEditors Editor de número
Hex ProbeView A menu item, as short as possible, noun is recommended if it is shorter than adjective. Hexa
No type editor available AttributeWindow Nenhum editor de tipo disponível
Double precision floating-point value: TypeEditors Valor de ponto flutuante de dupla precisão
Device: ProbeView Dispositivo
Double precision floating-point value: TypeEditors Valor de ponto flutuante de precisão dupla:
Device: ProbeView Dispositivo:
Do you really want to remove the attribute \"%s\" from the file \"%s\"?\n\nYou cannot undo this action. AttributeWindow Você realmente quer remover o atributo \"%s\" do arquivo \"%s\"?\n\nVocê não pode desfazer essa ação.
Text TypeEditors This is the type of editor Texto
8 bit unsigned value: TypeEditors Valor não assinado de 8 bit
Block ProbeView Bloquear
8 bit unsigned value: TypeEditors valor não assinado de 8 bit:
Block ProbeView Bloco
Back ProbeView Voltar
Device ProbeView Dispositivo
Unknown type TypeEditors Tipo desconhecido
Block 0x%Lx ProbeView Bloquear 0x%Lx
Block 0x%Lx ProbeView Bloco 0x%Lx
Quit FileWindow Sair
Undo ProbeView Desfazer
Close ProbeView Fechar
Number TypeEditors This is the type of editor Número
Decimal ProbeView A menu item, as short as possible, noun is recommended if it is shorter than adjective. Decimal
16 bit signed value: TypeEditors Valor assinado de 16 bit
16 bit signed value: TypeEditors valor assinado de 16 bit:
String editor TypeEditors Editor de expressões
of 0x0 ProbeView This is a part of 'Block 0xXXXX of 0x0026' message. In languages without 'of' structure it can be replaced simply with '/'. de 0x0
64 bit signed offset: TypeEditors Offset assinado de 64 bit
64 bit signed offset: TypeEditors offset assinado de 64 bit:
Boolean editor TypeEditors Editor booleano
Copy ProbeView Copiar
none ProbeView No attributes nenhum
Boolean value: TypeEditors Valor Booleano:
Boolean value: TypeEditors Valor booleano:
32 bit size or status: TypeEditors Tamanho de 32 bit ou status:
8 bit palette TypeEditors Paleta de 8 bit
Fit ProbeView Size of fonts, fits to available room Caber
Probe device OpenWindow Sondar dispositivo
Probe device OpenWindow Analisar dispositivo
(native) ProbeView (nativo)
Unknown format TypeEditors Formato desconhecido
Hexadecimal FindWindow A menu item, as short as possible, noun is recommended if it is shorter than adjective. Hexadecimal
MIME type: TypeEditors Tipo MIME:
Page setup… ProbeView Configurar página...
New… FileWindow Novo...
DiskProbe request AttributeWindow Requerimento de Sondagem do Disco
DiskProbe request AttributeWindow Solicitação do Analisador de Disco
Could not read image TypeEditors Image means here a picture file, not a disk image. Não foi possível ler a imagem
BlockSize ProbeView A menu item, a shortened form from 'block size'. This is in the same menu windowthan 'Base' and 'Font size' BlockSize
Save changes before closing? ProbeView Salvar alterações antes de fechar
BlockSize ProbeView A menu item, a shortened form from 'block size'. This is in the same menu windowthan 'Base' and 'Font size' Tamanho do bloco
Save changes before closing? ProbeView Salvar alterações antes de fechar?
Type editor AttributeWindow Editor de tipo
Native: 0x%0*Lx ProbeView Nativo: 0x%0*Lx
Raw editor AttributeWindow Editor em bruto
Message View TypeEditors Visualização de Mensagem
DiskProbe request ProbeView Requerimento de Sondagem do Disco
32 bit unsigned size: TypeEditors Tamanho não assinado de 32 bits
DiskProbe request ProbeView Solicitação do Analisador de Disco
32 bit unsigned size: TypeEditors tamanho não assinado de 32 bits:
Flattened bitmap TypeEditors Mapa de bits achatado
Open file… FileWindow Abrir arquivo…
Next ProbeView Próximo
@@ -83,7 +83,7 @@ Attribute: ProbeView Atributo:
Remove from file AttributeWindow Remover do arquivo
Don't save ProbeView Não salvar
Previous ProbeView Anterior
64 bit signed value: TypeEditors Valor assinado de 64 bit:
64 bit signed value: TypeEditors valor assinado de 64 bit:
Icon TypeEditors Ícone
Block: ProbeView Bloco:
Examine device: OpenWindow Examinar dispositivo:
@@ -104,7 +104,7 @@ Swapped: %Ld (0x%0*Lx) ProbeView Trocado: %Ld (0x%0*Lx)
Find FindWindow Localizar
Remove AttributeWindow Remover
Print… ProbeView Imprimir…
Block %Ld (0x%Lx) ProbeView Bloquear %Ld (0x%Lx)
Block %Ld (0x%Lx) ProbeView Bloco %Ld (0x%Lx)
Image TypeEditors This is the type of view Imagem
Could not open file \"%s\": %s\n DiskProbe Não foi possível abrir o arquivo \"%s\": %s\n
Select all ProbeView Selecionar tudo
@@ -115,12 +115,12 @@ Mode: FindWindow Modo:
15 bit TypeEditors 15 bits
Open device FileWindow Abrir dispositivo
Could not find search string. ProbeView Não foi possível encontrar expressão de pesquisa.
16 bit unsigned value: TypeEditors Valor não assinado de 16 bits
16 bit unsigned value: TypeEditors valor não assinado de 16 bits:
Attribute offset: ProbeView Compensação de atributo:
View ProbeView This is the last menubar item 'File Edit Block View' Ver
Redo ProbeView Refazer
File: ProbeView Arquivo:
32 bit unsigned pointer: TypeEditors Ponteiro não assinado de 32 bits
32 bit unsigned pointer: TypeEditors ponteiro não assinado de 32 bits:
of ProbeView de
Writing to the file failed:\n%s\n\nAll changes will be lost when you quit. ProbeView Gravaçao para o arquivo falhou:\n%s\n\nTodas as alterações serão perdidas quando sair.
32 bit TypeEditors 32 bits
@@ -128,6 +128,6 @@ Cancel ProbeView Cancelar
Swapped: 0x%0*Lx ProbeView Trocado: 0x%0*Lx
Grayscale TypeEditors Escala de cinza
32 bit signed value: TypeEditors Valor assinado de 32 bits
DiskProbe request DiskProbe Requerimento de Sondagem do Disco
DiskProbe request DiskProbe Solicitação do Analisador de Disco
Type editor ProbeView Editor de tipo
Contents: TypeEditors Conteúdo:
+3 -1
View File
@@ -1,4 +1,4 @@
1 german x-vnd.Haiku-DiskUsage 1726021626
1 german x-vnd.Haiku-DiskUsage 3848101922
Scanning %refName% Scanner Analysiere %refName%
Size Info Window Größe
Rescan Pie View Erneut analysieren
@@ -9,6 +9,7 @@ no supporting apps Pie View keine geeigneten Anwendungen
Path Info Window Pfad
Scan Status View Analyse
9999.99 GB Status View 9999,99 GiB
Rescan Status View Erneut analysieren
file unavailable Status View Datei nicht verfügbar
Get Info Pie View Datei-Info
DiskUsage System name Datenträgerbelegung
@@ -16,6 +17,7 @@ DiskUsage System name Datenträgerbelegung
%d files Status View %d Dateien
Created Info Window Erstellt
Modified Info Window Geändert
Abort Status View Abbrechen
Open Pie View Öffnen
Open With Pie View Öffnen mit
%a, %d %b %Y, %r Info Window %a, %d %b %Y, %r
+3 -1
View File
@@ -1,4 +1,4 @@
1 hungarian x-vnd.Haiku-DiskUsage 1726021626
1 hungarian x-vnd.Haiku-DiskUsage 3848101922
Scanning %refName% Scanner %refName% elemzése
Size Info Window Méret
Rescan Pie View Újraelemzés
@@ -9,6 +9,7 @@ no supporting apps Pie View nincs használható program
Path Info Window Útvonal
Scan Status View Elemzés
9999.99 GB Status View 9999,99 GB
Rescan Status View Újraelemzés
file unavailable Status View fájl nem elérhető
Get Info Pie View Információ
DiskUsage System name Lemezhasználat
@@ -16,6 +17,7 @@ DiskUsage System name Lemezhasználat
%d files Status View %d fájl
Created Info Window Létrehozva
Modified Info Window Módosítva
Abort Status View Megszakítás
Open Pie View Megnyitás
Open With Pie View Megnyitás ezzel
%a, %d %b %Y, %r Info Window %a, %d %b %Y, %r
+3 -1
View File
@@ -1,4 +1,4 @@
1 japanese x-vnd.Haiku-DiskUsage 1726021626
1 japanese x-vnd.Haiku-DiskUsage 3848101922
Scanning %refName% Scanner %refName%をスキャン中
Size Info Window サイズ
Rescan Pie View 再スキャン
@@ -9,6 +9,7 @@ no supporting apps Pie View 対象アプリケーション無し
Path Info Window パス
Scan Status View スキャン
9999.99 GB Status View 9999.99 GB
Rescan Status View 再スキャン
file unavailable Status View 利用できないファイル
Get Info Pie View 情報を表示
DiskUsage System name DiskUsage
@@ -16,6 +17,7 @@ DiskUsage System name DiskUsage
%d files Status View %d 個のファイル
Created Info Window 作成日時
Modified Info Window 更新日時
Abort Status View 中断
Open Pie View 開く
Open With Pie View アプリケーションで開く
%a, %d %b %Y, %r Info Window %a, %d %b %Y, %r
+3 -1
View File
@@ -1,4 +1,4 @@
1 portuguese (brazil) x-vnd.Haiku-DiskUsage 1726021626
1 portuguese (brazil) x-vnd.Haiku-DiskUsage 3848101922
Scanning %refName% Scanner Analisando %refName%
Size Info Window Tamanho
Rescan Pie View ReAnalisar
@@ -9,6 +9,7 @@ no supporting apps Pie View sem suporte a apps
Path Info Window Caminho
Scan Status View Analisar
9999.99 GB Status View 9999.99 Gb
Rescan Status View ReAnalisar
file unavailable Status View arquivo não disponível
Get Info Pie View Obter Informação
DiskUsage System name Uso de Disco
@@ -16,6 +17,7 @@ DiskUsage System name Uso de Disco
%d files Status View %d arquivos
Created Info Window Criado
Modified Info Window Modificado
Abort Status View Cancelar
Open Pie View Abrir
Open With Pie View Abrir Com
%a, %d %b %Y, %r Info Window %a, %d %b %Y, %r
+3 -1
View File
@@ -1,4 +1,4 @@
1 swedish x-vnd.Haiku-DiskUsage 1726021626
1 swedish x-vnd.Haiku-DiskUsage 3848101922
Scanning %refName% Scanner Skannar %refName%
Size Info Window Storlek
Rescan Pie View Skanna om
@@ -9,6 +9,7 @@ no supporting apps Pie View applikationsstöd saknas
Path Info Window Sökväg
Scan Status View Skanna
9999.99 GB Status View 9999.99 GB
Rescan Status View Skanna om
file unavailable Status View fil ej tillgänglig
Get Info Pie View Visa information
DiskUsage System name DiskAnvändning
@@ -16,6 +17,7 @@ DiskUsage System name DiskAnvändning
%d files Status View %d filer
Created Info Window Skapad
Modified Info Window Modifierad
Abort Status View Avbryt
Open Pie View Öppna
Open With Pie View Öppna med
%a, %d %b %Y, %r Info Window %a, %d %b %Y, %r
+9 -1
View File
@@ -1,4 +1,4 @@
1 swedish x-vnd.Haiku-Installer 303957964
1 swedish x-vnd.Haiku-Installer 3015727137
So behind the other menu entries towards the bottom of the file, add something similar to these lines:\n\n InstallerApp Efter de andra menyposterna mot slutet av filen, lägg till något som liknar dessa rader:\n\n
Are you sure you want to abort the installation and restart the system? InstallerWindow Är du säker på att du vill avbryta installationen och starta om systemet
\t}\n\n InstallerApp \t}\n\n
@@ -101,12 +101,20 @@ DriveSetup, the application to configure disk partitions, could not be launched.
No optional packages available. PackagesView Inga installationspaket fanns att välja.
All hard disks start with \"hd\".\n InstallerApp Alla hårdiskar startar med \"hd\".\n
Continue InstallerApp Fortsätt
BootManager, the application to configure the Haiku boot menu, could not be launched. InstallerWindow BootManager, applikationen för att configurera Haiku boot meny kunde inte startas.
Configure your /boot/grub/menu.lst by launching your favorite editor from a Terminal like this:\n\n InstallerApp Konfigurera /boot/grub/menu.lst genom att köra din favorit editor från Terminalen så här:\n\n
Boot sector not written because of an internal error. InstallProgress Gick inte att skriva till bootsektorn på grund av ett internt fel.
Additional disk space required: %s InstallerWindow Ytterligare diskutrymme behövs: %s
NOTE: While the naming strategy for hard disks is still as described under 2.1) the naming scheme for partitions has changed.\n\n InstallerApp NOITERA: Trots att namngivningen för hårddiskar fortfarande är som det beskrivs under 2.1) så har namngivningen för partitioner ändrats.\n\n
Cancel InstallProgress Avbryt
Running Boot Manager and DriveSetup…\n\nClose both applications to continue with the installation. InstallerWindow Kör Boot Manager och DriveSetup…\n\nStäng båda programmen för att fortsätta med installationen.
Try installing anyway InstallProgress Försök installera iallafall
Are you sure you want to to stop the installation? InstallerWindow Är du säker på att du vill stoppa installationen?
Onto: InstallerWindow På:
Please close the Boot Manager window before closing the Installer window. InstallerWindow Stäng Boot Manager fönstret före du stänger installatione fönstret.
3) When you successfully boot into Haiku for the first time, make sure to read our \"Welcome\" and \"Userguide\" documentation. There are links on the Desktop and in WebPositive's bookmarks.\n\n InstallerApp 3) När du har startat Haiku första gången. Läs gärna våra dokument \"Välkommen\" och \"Användarguid\". Det finns länkar på skrivbordet och i WebPositive's bokmärken.\n\n
Tools InstallerWindow Verktyg
The mount point could not be retrieved. InstallProgress Monteringspunkt kunde inte läsas av.
You can see the correct partition in GParted for example.\n\n\n InstallerApp Du kan se de rätta partionerna i tex GParted.\n\n\n
\ttitle\t\t\t\tHaiku\n InstallerApp \t titel\t \t \t \t Haiku\n
\tsudo <your favorite text editor> /etc/grub.d/40_custom\n\n InstallerApp \t sudo <valfri textredigerare> /etc/grub.d/40_custom\n\n
+2 -1
View File
@@ -1,4 +1,4 @@
1 german x-vnd.Haiku-Terminal 1294209621
1 german x-vnd.Haiku-Terminal 211651840
Not found. Terminal TermWindow Nicht gefunden.
Switch Terminals Terminal TermWindow Terminals wechseln
Change directory Terminal TermView Zum Ordner wechseln
@@ -50,6 +50,7 @@ The following processes are still running:\n\n\t%1\n\nIf you close the Terminal,
Insert path Terminal TermView Pfad einfügen
Haiku Terminal\nCopyright 2001-2009 Haiku, Inc.\nCopyright(C) 1999 Kazuho Okui and Takashi Murai.\n\nUsage: %s [OPTION] [SHELL]\n Terminal TermApp Haiku Terminal\nCopyright 2001-2009 Haiku, Inc.\nCopyright(C) 1999 Kazuho Okui und Takashi Murai.\n\nGebrauch: %s [OPTION] [SHELL]\n
No search string was entered. Terminal TermWindow Es wurde kein Suchbegriff eingegeben.
Blinking cursor Terminal AppearancePrefView Blinkender Cursor
Don't save Terminal PrefWindow Verwerfen
Set window title Terminal TermWindow Setze Fenstertitel
Terminal System name Terminal
+4 -1
View File
@@ -1,9 +1,10 @@
1 hungarian x-vnd.Haiku-Terminal 1294209621
1 hungarian x-vnd.Haiku-Terminal 3929743651
Not found. Terminal TermWindow Nem található.
Switch Terminals Terminal TermWindow Terminálok közti váltás
Change directory Terminal TermView Mappa váltása
OK Terminal TermWindow Rendben
New Terminal Terminal TermWindow Új terminál
Cursor text Terminal AppearancePrefView Kurzor szöveg
Terminal couldn't start the shell. Sorry. Terminal TermApp Sajnos, a terminálnak nem sikerült elindítani a shellt.
Text size Terminal TermWindow Betűméret
Match case Terminal FindWindow Betűérzékeny
@@ -50,6 +51,7 @@ The following processes are still running:\n\n\t%1\n\nIf you close the Terminal,
Insert path Terminal TermView Útvonal beszúrása
Haiku Terminal\nCopyright 2001-2009 Haiku, Inc.\nCopyright(C) 1999 Kazuho Okui and Takashi Murai.\n\nUsage: %s [OPTION] [SHELL]\n Terminal TermApp Haiku Terminál\nMinden jog fenntartva 2001-2009 Haiku, Inc.\nMinden jog fenntartva(C) 1999 Kazuho Okui és Takashi Murai.\n\nHasználata: %s [OPCIÓ] [SHELL]\n
No search string was entered. Terminal TermWindow Nincs beírva keresendő szöveg
Blinking cursor Terminal AppearancePrefView Villogó kurzor
Don't save Terminal PrefWindow Nincs mentés
Set window title Terminal TermWindow Ablak címének beállítása
Terminal System name Terminál
@@ -79,6 +81,7 @@ Set tab title Terminal TermWindow Lap címének beállítása
Settings… Terminal TermWindow Beállítások…
Abort Terminal Shell Megszakítás
Edit Terminal TermWindow Szerkesztés
Cursor background Terminal AppearancePrefView Kurzor háttere
Color: Terminal AppearancePrefView Szín:
The pattern specifying the window title. The following placeholders\ncan be used:\n Terminal TermWindow Az ablak címét meghatározó minta. A következő kódok használhatóak:
Print Terminal TermWindow Nyomtatás
+4 -1
View File
@@ -1,9 +1,10 @@
1 japanese x-vnd.Haiku-Terminal 1294209621
1 japanese x-vnd.Haiku-Terminal 3929743651
Not found. Terminal TermWindow これ以上見つかりません。
Switch Terminals Terminal TermWindow ターミナルを切替える
Change directory Terminal TermView ディレクトリを変更
OK Terminal TermWindow OK
New Terminal Terminal TermWindow 新しいターミナルを開く
Cursor text Terminal AppearancePrefView カーソル
Terminal couldn't start the shell. Sorry. Terminal TermApp すみません、シェルを起動できませんでした。
Text size Terminal TermWindow テキストサイズ
Match case Terminal FindWindow 大文字と小文字を区別する
@@ -50,6 +51,7 @@ The following processes are still running:\n\n\t%1\n\nIf you close the Terminal,
Insert path Terminal TermView パスを挿入
Haiku Terminal\nCopyright 2001-2009 Haiku, Inc.\nCopyright(C) 1999 Kazuho Okui and Takashi Murai.\n\nUsage: %s [OPTION] [SHELL]\n Terminal TermApp Haiku Terminal\nCopyright 2001-2009 Haiku, Inc.\nCopyright(C) 1999 Kazuho Okui and Takashi Murai.\n\nUsage: %s [OPTION] [SHELL]\n
No search string was entered. Terminal TermWindow 検索テキストが入力されていません。
Blinking cursor Terminal AppearancePrefView カーソルを点滅させる
Don't save Terminal PrefWindow 保存しない
Set window title Terminal TermWindow ウィンドウタイトルを設定
Terminal System name ターミナル
@@ -79,6 +81,7 @@ Set tab title Terminal TermWindow タブのタイトルを設定
Settings… Terminal TermWindow 設定…
Abort Terminal Shell 中断
Edit Terminal TermWindow 編集
Cursor background Terminal AppearancePrefView カーソルの背景
Color: Terminal AppearancePrefView 色:
The pattern specifying the window title. The following placeholders\ncan be used:\n Terminal TermWindow パターンはウィンドウタイトルを指定します。次のプレースホルダーが\n使用できます:\n
Print Terminal TermWindow 印刷
+4 -1
View File
@@ -1,9 +1,10 @@
1 portuguese (brazil) x-vnd.Haiku-Terminal 1294209621
1 portuguese (brazil) x-vnd.Haiku-Terminal 3929743651
Not found. Terminal TermWindow Não localizado.
Switch Terminals Terminal TermWindow Alternar Terminais
Change directory Terminal TermView Mudar de pasta
OK Terminal TermWindow OK
New Terminal Terminal TermWindow Novo Terminal
Cursor text Terminal AppearancePrefView Texto do cursor
Terminal couldn't start the shell. Sorry. Terminal TermApp Terminal não pôde iniciar o shell. Desculpe.
Text size Terminal TermWindow Tamanho do texto
Match case Terminal FindWindow Diferenciar maiúsculas de minúsculas
@@ -50,6 +51,7 @@ The following processes are still running:\n\n\t%1\n\nIf you close the Terminal,
Insert path Terminal TermView Inserir caminho
Haiku Terminal\nCopyright 2001-2009 Haiku, Inc.\nCopyright(C) 1999 Kazuho Okui and Takashi Murai.\n\nUsage: %s [OPTION] [SHELL]\n Terminal TermApp Terminal Haiku\nCopyright 2001-2009 Haiku, Inc.\nCopyright(C) 1999 Kazuho Okui e Takashi Murai.\n\nUtilização: %s [OPTION] [SHELL]\n
No search string was entered. Terminal TermWindow Não foi introduzida nenhuma expressão para localizar.
Blinking cursor Terminal AppearancePrefView Cursor piscante
Don't save Terminal PrefWindow Não salvar
Set window title Terminal TermWindow Definir título da janela
Terminal System name Terminal
@@ -79,6 +81,7 @@ Set tab title Terminal TermWindow Definir o título da guia
Settings… Terminal TermWindow Configurações...
Abort Terminal Shell Cancelar
Edit Terminal TermWindow Editar
Cursor background Terminal AppearancePrefView Plano de fundo do cursor
Color: Terminal AppearancePrefView Cor:
The pattern specifying the window title. The following placeholders\ncan be used:\n Terminal TermWindow O padrão especificando o título da janela. Os seguintes espaços reservados\npodem ser usados:\n
Print Terminal TermWindow Imprimir
+4 -1
View File
@@ -1,9 +1,10 @@
1 swedish x-vnd.Haiku-Terminal 1294209621
1 swedish x-vnd.Haiku-Terminal 3929743651
Not found. Terminal TermWindow Hittades ej.
Switch Terminals Terminal TermWindow Växla terminal
Change directory Terminal TermView Byt katalog
OK Terminal TermWindow OK
New Terminal Terminal TermWindow Ny terminal
Cursor text Terminal AppearancePrefView Markörtext
Terminal couldn't start the shell. Sorry. Terminal TermApp Terminalen kunde inte starta skalet.
Text size Terminal TermWindow Teckenstorlek
Match case Terminal FindWindow Matcha gemener/versaler
@@ -50,6 +51,7 @@ The following processes are still running:\n\n\t%1\n\nIf you close the Terminal,
Insert path Terminal TermView Lägg till sökväg
Haiku Terminal\nCopyright 2001-2009 Haiku, Inc.\nCopyright(C) 1999 Kazuho Okui and Takashi Murai.\n\nUsage: %s [OPTION] [SHELL]\n Terminal TermApp Haiku Terminal\nUpphovsrätt 2001-2009 Haiku, Inc.\nUpphovsrätt (C) 1999 Kazuho Okui and Takashi Murai.\n\nHantering: %s [OPTION] [SHELL]\n
No search string was entered. Terminal TermWindow Ingen söksträng angiven.
Blinking cursor Terminal AppearancePrefView Blinkande markör
Don't save Terminal PrefWindow Spara inte
Set window title Terminal TermWindow Ange fönstertitel
Terminal System name Terminal
@@ -79,6 +81,7 @@ Set tab title Terminal TermWindow Ange fliktitel
Settings… Terminal TermWindow Inställningar...
Abort Terminal Shell Avbryt
Edit Terminal TermWindow Redigera
Cursor background Terminal AppearancePrefView Markörbakgrund
Color: Terminal AppearancePrefView Färg:
The pattern specifying the window title. The following placeholders\ncan be used:\n Terminal TermWindow Mönstret bestämmer fönstrets namn. Följande alternativ finns:\n
Print Terminal TermWindow Skriv ut
+2 -2
View File
@@ -21,7 +21,7 @@ Settings Settings Window Beállítások
Confirmation WebPositive Window Megerősítés
Window WebPositive Window Ablak
Decrease size WebPositive Window Méret csökkentése
Serif font: Settings Window Serif betűtípus:
Serif font: Settings Window Talpas betűtípus:
Loading %url WebPositive Window %url betöltése
Page source WebPositive Window Oldal forrása
Next WebPositive Window Következő
@@ -48,7 +48,7 @@ New window WebPositive Window Új ablak
Open Download Window Megnyitás
Reload WebPositive Window Újratöltés
Downloads Download Window Letöltések
Sans serif font: Settings Window Sans serif betűtípus:
Sans serif font: Settings Window Talpatlan betűtípus:
Over %days days left Download Window Több, mint %days nap van hátra
Forward WebPositive Window Következő
of Download Window ...as in '12kB of 256kB' /
+2 -1
View File
@@ -1,9 +1,10 @@
1 swedish x-vnd.Haiku-desklink 3053930521
1 swedish x-vnd.Haiku-desklink 2797960853
Control physical output MediaReplicant Kontrollera fysisk utsignal
Couldn't launch MediaReplicant Kunde inte starta
OK MediaReplicant OK
Sound preferences… MediaReplicant Ljudinställningar...
%g dB MediaReplicant %g dB
Open %name DeskButton Don't translate variable %name Öppna %name
No media server running VolumeControl Ingen aktiv mediaserver
Media preferences… MediaReplicant Mediainställningar...
Open MediaPlayer MediaReplicant Öppna MediaSpelare
+11 -1
View File
@@ -1,21 +1,29 @@
1 german x-vnd.Haiku-libbe 864109244
1 german x-vnd.Haiku-libbe 672385853
gamma AboutWindow Gamma
beta AboutWindow Beta
%3.2f GiB StringForSize %3.2f GiB
Written by: AboutWindow Von:
About %app% AboutMenuItem Über %app%
Cut TextView Ausschneiden
Version AboutWindow Version
Cannot create the replicant for \"%description\".\n%error ZombieReplicantView Replikant für \"%description\" konnte nicht erstellt werden.\n%error
About AboutWindow Über
Copy TextView Kopieren
%3.2f KiB StringForSize %3.2f KiB
%d bytes StringForSize %d Bytes
alpha AboutWindow Alpha
Error PrintJob Fehler
No Pages to print! PrintJob Keine Seiten zu drucken!
All Rights Reserved. AboutWindow Alle Rechte vorbehalten.
OK Dragger OK
OK PrintJob OK
Green: ColorControl Grün:
Version history: AboutWindow Historie:
Remove replicant Dragger Replikant entfernen
OK ZombieReplicantView OK
Print Server is not responding. PrintJob Drucker-Server reagiert nicht.
Paste TextView Einfügen
Special Thanks: AboutWindow Besonderen Dank an:
%.2f TiB StringForSize %.2f TiB
Cannot locate the application for the replicant. No application signature supplied.\n%error ZombieReplicantView Das Ursprungsprogramm für den Replikanten konnte nicht gefunden werden, da keine Programm-Signatur zur Verfügung steht.\n%error
Redo TextView Wiederholen
@@ -26,6 +34,8 @@ Undo TextView Rückgängig
Red: ColorControl Rot:
%3.2f MiB StringForSize %3.2f MiB
About %app… Dragger Über %app...
development AboutWindow Entwicklung
Error ZombieReplicantView Fehler
Blue: ColorControl Blau:
gold master AboutWindow Golden Master
Can't delete this replicant from its original application. Life goes on. Dragger Dieser Replikant kann nicht von seinem Ursprungsprogramm entfernt werden. Das Leben geht weiter.
+11 -1
View File
@@ -1,21 +1,29 @@
1 hungarian x-vnd.Haiku-libbe 864109244
1 hungarian x-vnd.Haiku-libbe 672385853
gamma AboutWindow gamma
beta AboutWindow béta
%3.2f GiB StringForSize %3.2f GB
Written by: AboutWindow Írta:
About %app% AboutMenuItem %app% névjegye
Cut TextView Kivágás
Version AboutWindow Verzió
Cannot create the replicant for \"%description\".\n%error ZombieReplicantView Nem lehet replikánst létrehozni ehhez: %description.\n%error
About AboutWindow Névjegy
Copy TextView Másolás
%3.2f KiB StringForSize %3.2f KB
%d bytes StringForSize %Ld byte
alpha AboutWindow alfa
Error PrintJob Hiba
No Pages to print! PrintJob Nincs nyomtatható oldal!
All Rights Reserved. AboutWindow Minden jog fenntartva.
OK Dragger Rendben
OK PrintJob Rendben
Green: ColorControl Zöld:
Version history: AboutWindow Előző verziók:
Remove replicant Dragger Replikáns eltávolítása
OK ZombieReplicantView Rendben
Print Server is not responding. PrintJob A nyomtatókiszolgáló nem válaszol.
Paste TextView Beillesztés
Special Thanks: AboutWindow Külön köszönet:
%.2f TiB StringForSize %.2f TB
Cannot locate the application for the replicant. No application signature supplied.\n%error ZombieReplicantView Nem található a replikánshoz tartozó program. Nincs megadva programaláírás.\n%error
Redo TextView Újra
@@ -26,6 +34,8 @@ Undo TextView Visszavonás
Red: ColorControl Vörös:
%3.2f MiB StringForSize %3.2f MB
About %app… Dragger %app névjegye…
development AboutWindow fejlesztés
Error ZombieReplicantView Hiba
Blue: ColorControl Kék:
gold master AboutWindow arany fokozatú
Can't delete this replicant from its original application. Life goes on. Dragger Nem lehet ezt a replikánst törölni az eredeti programtól.
+7 -4
View File
@@ -1,9 +1,11 @@
1 japanese x-vnd.Haiku-libbe 864109244
1 japanese x-vnd.Haiku-libbe 2804831005
%3.2f GiB StringForSize %3.2f GiB
Written by: AboutWindow 作者
About %app% AboutMenuItem %app%について
Written by: AboutWindow 作者:
About %app% AboutMenuItem %app% について
Cut TextView 切り取り
Cannot create the replicant for \"%description\".\n%error ZombieReplicantView \"%description\"用のレプリカントを作成できません。\n%error
Version AboutWindow バージョン
Cannot create the replicant for \"%description\".\n%error ZombieReplicantView \"%description\" 用のレプリカントを作成できません。\n%error
About AboutWindow このソフトウェアについて…
Copy TextView コピー
%3.2f KiB StringForSize %3.2f KiB
%d bytes StringForSize %d バイト
@@ -12,6 +14,7 @@ No Pages to print! PrintJob 印刷するページがありません。
OK Dragger OK
OK PrintJob OK
Green: ColorControl 緑:
Version history: AboutWindow 改訂履歴:
Remove replicant Dragger レプリカントを削除
OK ZombieReplicantView OK
Print Server is not responding. PrintJob プリントサーバーが応答しません。
+11 -1
View File
@@ -1,21 +1,29 @@
1 portuguese (brazil) x-vnd.Haiku-libbe 864109244
1 portuguese (brazil) x-vnd.Haiku-libbe 672385853
gamma AboutWindow gama
beta AboutWindow beta
%3.2f GiB StringForSize %3.2f GB
Written by: AboutWindow Escrito por:
About %app% AboutMenuItem Sobre %app%
Cut TextView Cortar
Version AboutWindow Versão
Cannot create the replicant for \"%description\".\n%error ZombieReplicantView Não é possível criar o replicante para \"%description\".\n%error
About AboutWindow Sobre
Copy TextView Copiar
%3.2f KiB StringForSize %3.2f KB
%d bytes StringForSize %d bytes
alpha AboutWindow alfa
Error PrintJob Erro
No Pages to print! PrintJob Nenhuma Página para imprimir!
All Rights Reserved. AboutWindow Todos os direitos reservados.
OK Dragger OK
OK PrintJob OK
Green: ColorControl Verde:
Version history: AboutWindow Histórico de versões
Remove replicant Dragger Remover replicante
OK ZombieReplicantView OK
Print Server is not responding. PrintJob Servidor de impressão não está respondendo.
Paste TextView Colar
Special Thanks: AboutWindow Agradecimentos Especiais
%.2f TiB StringForSize %.2f TB
Cannot locate the application for the replicant. No application signature supplied.\n%error ZombieReplicantView Não é possível localizar o aplicativo para o replicante. Nenhuma assinatura de aplicativo fornecida.\n%error
Redo TextView Refazer
@@ -26,6 +34,8 @@ Undo TextView Desfazer
Red: ColorControl Vermelho:
%3.2f MiB StringForSize %3.2f MB
About %app… Dragger Sobre %app…
development AboutWindow desenvolvimento
Error ZombieReplicantView Erro
Blue: ColorControl Azul:
gold master AboutWindow cópia mestra
Can't delete this replicant from its original application. Life goes on. Dragger Não é possível excluir este replicante de seu aplicativo original. A vida continua.
+11 -1
View File
@@ -1,21 +1,29 @@
1 swedish x-vnd.Haiku-libbe 864109244
1 swedish x-vnd.Haiku-libbe 672385853
gamma AboutWindow gamma
beta AboutWindow beta
%3.2f GiB StringForSize %3.2f GiB
Written by: AboutWindow Skrivet av:
About %app% AboutMenuItem Om %app%
Cut TextView Klippa ut
Version AboutWindow Version
Cannot create the replicant for \"%description\".\n%error ZombieReplicantView Kan inte skapa replikanten för "%description".\n%error
About AboutWindow Om
Copy TextView Kopiera
%3.2f KiB StringForSize %3.2f KiB
%d bytes StringForSize %d byte
alpha AboutWindow alfa
Error PrintJob Fel
No Pages to print! PrintJob Inga sidor att skriva ut!
All Rights Reserved. AboutWindow Alla rättigheter resarverade.
OK Dragger OK
OK PrintJob OK
Green: ColorControl Grön:
Version history: AboutWindow Versionshistorik:
Remove replicant Dragger Ta bort replikant
OK ZombieReplicantView OK
Print Server is not responding. PrintJob Utskriftservern svarar inte.
Paste TextView Klistra in
Special Thanks: AboutWindow Särskilt tack till:
%.2f TiB StringForSize %.2f TiB
Cannot locate the application for the replicant. No application signature supplied.\n%error ZombieReplicantView Kan inte hitta programmet för replikanten. Ingen programsignatur är angiven.\n%error
Redo TextView Gör om
@@ -26,6 +34,8 @@ Undo TextView Ångra
Red: ColorControl Röd:
%3.2f MiB StringForSize %3.2f MiB
About %app… Dragger Om %app...
development AboutWindow utveckling
Error ZombieReplicantView Fel
Blue: ColorControl Blå:
gold master AboutWindow guld mästare
Can't delete this replicant from its original application. Life goes on. Dragger Kan inte ta bort replikanten från dess program. Livet fortsätter som vanligt.
+2 -1
View File
@@ -1,4 +1,4 @@
1 german x-vnd.Haiku-libtracker 1301055003
1 german x-vnd.Haiku-libtracker 3955647850
common B_COMMON_DIRECTORY Allgemein
OK WidgetAttributeText OK
Icon view VolumeWindow Icon-Ansicht
@@ -452,6 +452,7 @@ Mount DeskWindow Einhängen
Mount ContainerWindow Einhängen
%capacity (%used used -- %free free) InfoWindow %capacity (%used benutzt -- %free frei)
Cancel FSClipBoard Abbrechen
Restart Deskbar DeskWindow Deskbar neu starten
Cut more ContainerWindow Mehr ausschneiden
Deleting: StatusWindow Löschen:
Empty Trash InfoWindow Papierkorb leeren
+2 -1
View File
@@ -1,4 +1,4 @@
1 hungarian x-vnd.Haiku-libtracker 1301055003
1 hungarian x-vnd.Haiku-libtracker 3955647850
common B_COMMON_DIRECTORY Közös
OK WidgetAttributeText Rendben
Icon view VolumeWindow Ikon nézet
@@ -452,6 +452,7 @@ Mount DeskWindow Csatolás
Mount ContainerWindow Csatolás
%capacity (%used used -- %free free) InfoWindow %capacity (%used használt -- %free szabad)
Cancel FSClipBoard Mégse
Restart Deskbar DeskWindow Asztalsáv újraindítása
Cut more ContainerWindow Több kivágása
Deleting: StatusWindow Törlés:
Empty Trash InfoWindow Szemetes ürítése
+2 -1
View File
@@ -1,4 +1,4 @@
1 japanese x-vnd.Haiku-libtracker 1680698556
1 japanese x-vnd.Haiku-libtracker 40324107
OK WidgetAttributeText OK
Icon view VolumeWindow アイコン表示
Add-ons FilePanelPriv アドオン
@@ -447,6 +447,7 @@ Mount DeskWindow マウント
Mount ContainerWindow マウント
%capacity (%used used -- %free free) InfoWindow %capacity (%used 使用中 -- %free 使用可能)
Cancel FSClipBoard 中止
Restart Deskbar DeskWindow Deskbar を再起動
Cut more ContainerWindow さらに切り取る
Deleting: StatusWindow 削除中:
Empty Trash InfoWindow ごみ箱を空にする
+2 -1
View File
@@ -1,4 +1,4 @@
1 portuguese (brazil) x-vnd.Haiku-libtracker 1301055003
1 portuguese (brazil) x-vnd.Haiku-libtracker 3955647850
common B_COMMON_DIRECTORY comum
OK WidgetAttributeText OK
Icon view VolumeWindow Em ícones
@@ -452,6 +452,7 @@ Mount DeskWindow Montar
Mount ContainerWindow Montar
%capacity (%used used -- %free free) InfoWindow %capacity (%used utilizados -- %free livres)
Cancel FSClipBoard Cancelar
Restart Deskbar DeskWindow Reiniciar a Deskbar
Cut more ContainerWindow Cortar mais
Deleting: StatusWindow Excluindo:
Empty Trash InfoWindow Esvaziar Lixeira
+2 -1
View File
@@ -1,4 +1,4 @@
1 swedish x-vnd.Haiku-libtracker 1301055003
1 swedish x-vnd.Haiku-libtracker 3955647850
common B_COMMON_DIRECTORY gemensam
OK WidgetAttributeText OK
Icon view VolumeWindow Ikonvy
@@ -452,6 +452,7 @@ Mount DeskWindow Montera
Mount ContainerWindow Montera
%capacity (%used used -- %free free) InfoWindow %capacity (%used använt -- %free ledigt)
Cancel FSClipBoard Avbryt
Restart Deskbar DeskWindow Starta om Deskbaren
Cut more ContainerWindow Klipp ut mer
Deleting: StatusWindow Tar bort:
Empty Trash InfoWindow Töm papperskorg
@@ -1,4 +1,4 @@
1 german x-vnd.Haiku-Appearance 1428480647
1 german x-vnd.Haiku-Appearance 2950529393
Plain font: Font view Normal:
Control highlight Colors tab Steuerelement - Ausgewählt
Control border Colors tab Steuerelement - Rahmen
@@ -23,27 +23,33 @@ Tooltip background Colors tab Tooltip - Hintergrund
Selected menu item background Colors tab Menü - Hintergrund (ausgewählt)
Antialiasing APRWindow Kantenglättung
Navigation base Colors tab Navigation - Grundfarbe
Selected list item text Colors tab Liste - Text (ausgewählt)
Window border Colors tab Fenster - Rahmen
Double: DecorSettingsView Doppelt:
Window tab text Colors tab Reiter - Text
Document text Colors tab Dokument - Text
Navigation pulse Colors tab Navigation - Leuchtfarbe
Window decorator: DecorSettingsView Fenster-Dekorator:
Selected menu item text Colors tab Menü - Text (ausgewählt)
Menu background Colors tab Menü - Hintergrund
List background Colors tab Liste - Hintergrund
OK DecorSettingsView OK
Control mark Colors tab Steuerelement - Markierung
Size: Font Selection view Größe:
Selected list item background Colors tab Liste - Hintergrund (ausgewählt)
Panel background Colors tab Oberfläche - Hintergrund
Menu font: Font view Menü:
Colors APRWindow Farben
Control background Colors tab Steuerelement - Hintergrund
Inactive window tab Colors tab Reiter (inaktiv)
List item text Colors tab Liste - Text
Appearance System name Erscheinungsbild
Fixed font: Font view Feste Breite:
The quick brown fox jumps over the lazy dog. Font Selection view Don't translate this literally ! Use a phrase showing all chars from A to Z. Franz jagt im total verwahrlosten Taxi quer durch Bayern.
Reduce colored edges filter strength: AntialiasingSettingsView Farbsaumfilter:
Subpixel based anti-aliasing in combination with glyph hinting is not available in this build of Haiku to avoid possible patent issues. To enable this feature, you have to build Haiku yourself and enable certain options in the libfreetype configuration header. AntialiasingSettingsView Zur Vermeidung von möglichen Patentproblemen ist die Kombination von Subpixel-Kantenglättung und Glyph-Hinting deaktiviert. Um diese Funktion zu aktivieren, müssen spezielle Optionen im Konfigurationsheader der Freetype-Bibliothek freigeschaltet und anschließend Haiku neu kompiliert werden.
Control text Colors tab Steuerelement - Text
Single: DecorSettingsView Einfach:
Tooltip text Colors tab Tooltip - Text
Bold font: Font view Fett:
Inactive window border Colors tab Fenster - Rahmen (inaktiv)
@@ -52,6 +58,7 @@ LCD subpixel AntialiasingSettingsView LCD-Subpixel
Selected menu item border Colors tab Menü - Rahmen (ausgewählt)
Strong AntialiasingSettingsView Stark
Panel text Colors tab Fenster - Text
Arrow style DecorSettingsView Scroll-Pfeile
Monospaced fonts only AntialiasingSettingsView Nur nicht-proportionale Schriften
Look and feel APRWindow Aussehen & Handhabung
Antialiasing menu AntialiasingSettingsView Kantenglättungs-Menü
@@ -1,4 +1,4 @@
1 hungarian x-vnd.Haiku-Appearance 1428480647
1 hungarian x-vnd.Haiku-Appearance 2950529393
Plain font: Font view Alap betűtípus:
Control highlight Colors tab Kiválasztott vezérlőelem
Control border Colors tab Vezérlőelem kerete
@@ -23,27 +23,33 @@ Tooltip background Colors tab Eszköztár háttere
Selected menu item background Colors tab Kiválasztott menüelem háttere
Antialiasing APRWindow Élsimítás
Navigation base Colors tab Navigációs alapszín
Selected list item text Colors tab Kiválasztott listaelem
Window border Colors tab Ablakkeret
Double: DecorSettingsView Dupla:
Window tab text Colors tab Ablakfül szövege
Document text Colors tab Dokumentumszöveg
Navigation pulse Colors tab Navigációs pulzálás
Window decorator: DecorSettingsView Ablakdekoráció:
Selected menu item text Colors tab Kiválasztott menüelem
Menu background Colors tab Menü háttere
List background Colors tab Lista háttere
OK DecorSettingsView Rendben
Control mark Colors tab Vezérlőelem jelölése
Size: Font Selection view Méret:
Selected list item background Colors tab Kiválasztott listaelem háttere
Panel background Colors tab Panel háttere
Menu font: Font view Menü betütípusa:
Colors APRWindow Színek
Control background Colors tab Kiválasztás háttere
Inactive window tab Colors tab Inaktív ablak füle
List item text Colors tab Listaelem
Appearance System name Megjelenés
Fixed font: Font view Rögzített szélességű betűtípus:
The quick brown fox jumps over the lazy dog. Font Selection view Don't translate this literally ! Use a phrase showing all chars from A to Z. Árvíztűrő tükörfúrógép.
Reduce colored edges filter strength: AntialiasingSettingsView A színezett betűszélek szűrőjének erősségi szintje:
Subpixel based anti-aliasing in combination with glyph hinting is not available in this build of Haiku to avoid possible patent issues. To enable this feature, you have to build Haiku yourself and enable certain options in the libfreetype configuration header. AntialiasingSettingsView A betűkép-körvonalasítással összevont szubpixel-alapú élsimítás nem használható a Haiku ezen kiadásában, mivel lehetséges szabadalmi viták forrása lehet. E funckió használatához magának kell megépítenie saját Haiku-rendszerét és beállítania bizonyos opciókat a libfreetype konfigurációs fejlécében.
Control text Colors tab Vezérlőelem szövege
Single: DecorSettingsView Egyszeres:
Tooltip text Colors tab Buboréksúgó szövege
Bold font: Font view Félkövér betű:
Inactive window border Colors tab Inaktív ablakkeret
@@ -52,6 +58,7 @@ LCD subpixel AntialiasingSettingsView LCD-szubpixel
Selected menu item border Colors tab Kiválasztott menüelem szegélye
Strong AntialiasingSettingsView Erős
Panel text Colors tab Panel szövege
Arrow style DecorSettingsView Nyíl stílusa
Monospaced fonts only AntialiasingSettingsView Csak rögzített szélességű betűtípusok
Look and feel APRWindow Megjelenés
Antialiasing menu AntialiasingSettingsView Élsimítási menü
@@ -1,4 +1,4 @@
1 japanese x-vnd.Haiku-Appearance 1428480647
1 japanese x-vnd.Haiku-Appearance 580285868
Plain font: Font view 標準フォント:
Control highlight Colors tab コントロールのハイライト
Control border Colors tab コントロールの境界
@@ -23,6 +23,7 @@ Tooltip background Colors tab ツールチップの背景
Selected menu item background Colors tab メニュー選択項目の背景
Antialiasing APRWindow アンチエイリアス
Navigation base Colors tab ナビゲーション
Selected list item text Colors tab リスト選択項目の文字
Window border Colors tab ウィンドウ枠
Window tab text Colors tab ウィンドウタブの文字
Document text Colors tab ドキュメントの文字
@@ -30,14 +31,17 @@ Navigation pulse Colors tab ナビゲーションの点滅
Window decorator: DecorSettingsView ウィンドウデコレーター:
Selected menu item text Colors tab メニュー選択項目の文字
Menu background Colors tab メニューの背景
List background Colors tab リストの背景
OK DecorSettingsView OK
Control mark Colors tab コントロールの選択部
Size: Font Selection view サイズ:
Selected list item background Colors tab リスト選択項目の背景
Panel background Colors tab パネルの背景
Menu font: Font view メニューフォント:
Colors APRWindow 色
Control background Colors tab コントロールの背景
Inactive window tab Colors tab 非アクティブウィンドウタブ
List item text Colors tab リスト項目の文字
Appearance System name 外観
Fixed font: Font view 等幅フォント:
The quick brown fox jumps over the lazy dog. Font Selection view Don't translate this literally ! Use a phrase showing all chars from A to Z. 古池や A frog jumps in, 水の音。
@@ -52,6 +56,7 @@ LCD subpixel AntialiasingSettingsView LCD サブピクセル
Selected menu item border Colors tab メニュー選択項目の境界
Strong AntialiasingSettingsView 強い
Panel text Colors tab パネルの文字
Arrow style DecorSettingsView 矢印のスタイル
Monospaced fonts only AntialiasingSettingsView 等幅フォントのみ有効
Look and feel APRWindow 外観
Antialiasing menu AntialiasingSettingsView アンチエイリアスメニュー
@@ -1,4 +1,4 @@
1 portuguese (brazil) x-vnd.Haiku-Appearance 1428480647
1 portuguese (brazil) x-vnd.Haiku-Appearance 2950529393
Plain font: Font view Fonte plana:
Control highlight Colors tab Realce do controle
Control border Colors tab Borda do controle
@@ -23,27 +23,33 @@ Tooltip background Colors tab Plano de fundo das dicas
Selected menu item background Colors tab Plano de fundo do item de menu selecionado
Antialiasing APRWindow Suavização de serrilhado
Navigation base Colors tab Base de navegação
Selected list item text Colors tab Texto do item da lista selecionado
Window border Colors tab Margem da janela
Double: DecorSettingsView Duplo:
Window tab text Colors tab Texto da aba da Janela
Document text Colors tab Texto do documento
Navigation pulse Colors tab Navegação de pulso
Window decorator: DecorSettingsView Decorador de janela:
Selected menu item text Colors tab Texto do item do menu selecionado
Menu background Colors tab Plano de fundo de menu
List background Colors tab Plano de fundo da lista
OK DecorSettingsView OK
Control mark Colors tab Marca de controle
Size: Font Selection view Tamanho:
Selected list item background Colors tab Plano de fundo do item de lista selecionado
Panel background Colors tab Plano de fundo do painel
Menu font: Font view Fonte de menu:
Colors APRWindow Cores
Control background Colors tab Plano de fundo do controle
Inactive window tab Colors tab Aba da janela inativa
List item text Colors tab Texto do item da lista
Appearance System name Aparência
Fixed font: Font view Fonte de largura fixa:
The quick brown fox jumps over the lazy dog. Font Selection view Don't translate this literally ! Use a phrase showing all chars from A to Z. Yuri viu um pequeno jabuti xereta e dez cegonhas felizes comendo kiwi.
Reduce colored edges filter strength: AntialiasingSettingsView Reduzir a força do filtro de bordas coloridas:
Subpixel based anti-aliasing in combination with glyph hinting is not available in this build of Haiku to avoid possible patent issues. To enable this feature, you have to build Haiku yourself and enable certain options in the libfreetype configuration header. AntialiasingSettingsView A possibilidade de usar o antiserrilhamento baseado em Subpíxeis juntamente com o alisamento de glifos não está disponível nesta versão do Haiku para evitar possíveis problemas com patentes. Para habilitar esta funcionalidade, você terá que compilar o Haiku e ativar certas opções no cabeçalho de configuração da libfreetype.
Control text Colors tab Texto do controle
Single: DecorSettingsView Único:
Tooltip text Colors tab Texto da dica
Bold font: Font view Negrito:
Inactive window border Colors tab Margem inativa de janela
@@ -52,6 +58,7 @@ LCD subpixel AntialiasingSettingsView Subpixel LCD
Selected menu item border Colors tab Borda do item de menu selecionado
Strong AntialiasingSettingsView Forte
Panel text Colors tab Texto de janela de diálogo
Arrow style DecorSettingsView Estilo da seta
Monospaced fonts only AntialiasingSettingsView Apenas fontes monoespaçadas
Look and feel APRWindow Olhar e sentir
Antialiasing menu AntialiasingSettingsView Menu de suavização de serrilhado
@@ -1,4 +1,4 @@
1 swedish x-vnd.Haiku-Appearance 1428480647
1 swedish x-vnd.Haiku-Appearance 2950529393
Plain font: Font view Vanlig font:
Control highlight Colors tab Framhävd kontroll
Control border Colors tab Kontrollkant
@@ -23,27 +23,33 @@ Tooltip background Colors tab Hjälprutsbakgrund
Selected menu item background Colors tab Bakgrund för valt menyalternativ
Antialiasing APRWindow Kantutjämning
Navigation base Colors tab Navigeringsbas
Selected list item text Colors tab Textfärg för valt menyalternativ
Window border Colors tab Fönsterkant
Double: DecorSettingsView Dubbel
Window tab text Colors tab Fönsterflik text
Document text Colors tab Dokument text
Navigation pulse Colors tab Navigeringspuls
Window decorator: DecorSettingsView Fönsterdekor:
Selected menu item text Colors tab Textfärg för valt menyalternativ
Menu background Colors tab Menybakgrund
List background Colors tab Lista bakgrund
OK DecorSettingsView OK
Control mark Colors tab Kontroll märke
Size: Font Selection view Storlek:
Selected list item background Colors tab Bakgrund för valt menyalternativ
Panel background Colors tab Panelbakgrund
Menu font: Font view Menu font:
Colors APRWindow Färger
Control background Colors tab Kontrollbakgrund
Inactive window tab Colors tab Flikfärg för inaktiva fönster
List item text Colors tab List objekt text
Appearance System name Utseende
Fixed font: Font view Fixerad font:
The quick brown fox jumps over the lazy dog. Font Selection view Don't translate this literally ! Use a phrase showing all chars from A to Z. Flygande bäckasiner söka strax hwila på mjuka tuvor.
Reduce colored edges filter strength: AntialiasingSettingsView Minska färgintensitet på färgade kanter:
Subpixel based anti-aliasing in combination with glyph hinting is not available in this build of Haiku to avoid possible patent issues. To enable this feature, you have to build Haiku yourself and enable certain options in the libfreetype configuration header. AntialiasingSettingsView Subpixel-baserad kantutjämning i kombination med betoning av typsnitt är inte tillgängligt i färdigbyggda Haiku för att undvika patentproblem. För att aktivera denna funktionalitet, måste du själv kompilera Haiku och välja särskilda val i libfreetypes konfigurationshuvud.
Control text Colors tab Kontrolltext
Single: DecorSettingsView Enkel:
Tooltip text Colors tab Hjälprutstext
Bold font: Font view Fetstil
Inactive window border Colors tab Inaktiverad fönsterkant
@@ -52,6 +58,7 @@ LCD subpixel AntialiasingSettingsView LCD-subpixel
Selected menu item border Colors tab Kantfärg för valt menyalternativ
Strong AntialiasingSettingsView Framhävd
Panel text Colors tab Paneltext
Arrow style DecorSettingsView Pil stil
Monospaced fonts only AntialiasingSettingsView Endast typsnitt med fast bredd
Look and feel APRWindow Utseende och beteende
Antialiasing menu AntialiasingSettingsView Kantutjämningsmeny
+2 -1
View File
@@ -1,3 +1,4 @@
1 german x-vnd.Haiku-debug_server 3203333611
1 german x-vnd.Haiku-debug_server 945172012
Debug DebugServer Debug
Kill DebugServer Beenden erzwingen
The application:\n\n %app\n\nhas encountered an error which prevents it from continuing. Haiku will terminate the application and clean up. DebugServer Die Anwendung:\n\n %app\n\nist auf einen Fehler gestoßen und kann nicht weiter ausgeführt werden. Haiku wird die Anwendung beenden und das System säubern.
+2 -1
View File
@@ -1,3 +1,4 @@
1 hungarian x-vnd.Haiku-debug_server 3203333611
1 hungarian x-vnd.Haiku-debug_server 945172012
Debug DebugServer Hibakeresés
Kill DebugServer Megszakítás
The application:\n\n %app\n\nhas encountered an error which prevents it from continuing. Haiku will terminate the application and clean up. DebugServer A következő program:\n\n %app\n\nhibába ütközött, és nem tud tovább futni. A Haiku leállítja a programot.
+2 -1
View File
@@ -1,3 +1,4 @@
1 japanese x-vnd.Haiku-debug_server 3203333611
1 japanese x-vnd.Haiku-debug_server 945172012
Debug DebugServer デバッグ
Kill DebugServer 強制終了
The application:\n\n %app\n\nhas encountered an error which prevents it from continuing. Haiku will terminate the application and clean up. DebugServer アプリケーション:\n\n %app\n\nは、エラーのため続行できません。Haiku はアプリケーションを終了し、後始末をします。
+2 -1
View File
@@ -1,3 +1,4 @@
1 portuguese (brazil) x-vnd.Haiku-debug_server 3203333611
1 portuguese (brazil) x-vnd.Haiku-debug_server 945172012
Debug DebugServer Depurar
Kill DebugServer Matar
The application:\n\n %app\n\nhas encountered an error which prevents it from continuing. Haiku will terminate the application and clean up. DebugServer A aplicação:\n\n %app\n\nencontrou um erro que a impede de continuar. Haiku irá fechar a aplicação.
+2 -1
View File
@@ -1,3 +1,4 @@
1 swedish x-vnd.Haiku-debug_server 3203333611
1 swedish x-vnd.Haiku-debug_server 945172012
Debug DebugServer Felsök
Kill DebugServer Döda
The application:\n\n %app\n\nhas encountered an error which prevents it from continuing. Haiku will terminate the application and clean up. DebugServer Programmet:\n\n %app\n\nhar stött på ett fel som förhindrar den från att fortsätta. Haiku kommer att avsluta programmet och stöda upp.
Binary file not shown.
+10 -7
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2009, Haiku, Inc. All rights reserved.
* Copyright 2009-2012, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _MEDIA_NODE_H
@@ -92,7 +92,7 @@ struct media_request_info {
what_code what;
int32 change_tag;
status_t status;
int32 cookie;
void* cookie;
void* user_data;
media_source source;
media_destination destination;
@@ -115,11 +115,13 @@ struct media_node_attribute {
};
namespace BPrivate { namespace media {
class TimeSourceObject;
class SystemTimeSourceObject;
class BMediaRosterEx;
} } // BPrivate::media
namespace BPrivate {
namespace media {
class TimeSourceObject;
class SystemTimeSourceObject;
class BMediaRosterEx;
}
} // BPrivate::media
/*! BMediaNode is the indirect base class for all Media Kit participants.
@@ -338,4 +340,5 @@ private:
// not to be confused with _mChangeCount
};
#endif // _MEDIA_NODE_H
+34 -23
View File
@@ -18,21 +18,21 @@
/*
* L1 defines for the page directory (page table walk methods)
*/
#define MMU_L1_TYPE_FAULT 0x0
#define ARM_MMU_L1_TYPE_FAULT 0x0
// MMU Fault
// 31 2 10
// | |00|
#define MMU_L1_TYPE_SECTION 0x2
#define ARM_MMU_L1_TYPE_SECTION 0x2
// Single step table walk, 4096 entries
// 1024K pages, 16K consumed
// 31 20 19 12 11 10 9 8 5 432 10
// | page table address | 0? | AP |0| domain |1CB|10|
#define MMU_L1_TYPE_FINE 0x3
#define ARM_MMU_L1_TYPE_FINE 0x3
// Three(?) step table walk, 1024 entries
// 1K, 4K, 64K pages, 4K consumed
// 31 12 11 9 8 5 432 10
// | page table address | 0? | domain |100|11|
#define MMU_L1_TYPE_COARSE 0x1
#define ARM_MMU_L1_TYPE_COARSE 0x1
// Two step table walk, 256 entries
// 4K(Haiku), 64K pages, 1K consumed
// 31 10 9 8 5 432 10
@@ -52,37 +52,48 @@
* I will use the old format...
*/
#define MMU_L2_TYPE_SMALLEXT 0x3
#define ARM_MMU_L2_TYPE_LARGE 0x1
#define ARM_MMU_L2_TYPE_SMALLEXT 0x3
/* for new format entries (cortex-a8) */
#define MMU_L2_TYPE_SMALLNEW 0x2
#define ARM_MMU_L2_TYPE_SMALLNEW 0x2
// for B C and TEX see ARM arm B4-11
#define MMU_L2_FLAG_B 0x4
#define MMU_L2_FLAG_C 0x8
#define MMU_L2_FLAG_TEX 0 // use 0b000 as TEX
#define MMU_L2_FLAG_AP_RW 0x30 // allow read and write for user and system
// #define MMU_L2_FLAG_AP_
#define ARM_MMU_L2_FLAG_B 0x4
#define ARM_MMU_L2_FLAG_C 0x8
#define ARM_MMU_L2_FLAG_TEX 0 // use 0b000 as TEX
#define ARM_MMU_L2_FLAG_AP_RW 0x30
// allow read and write for user and system
#define ARM_MMU_L1_TABLE_ENTRY_COUNT 4096
#define ARM_MMU_L1_TABLE_SIZE (ARM_MMU_L1_TABLE_ENTRY_COUNT \
* sizeof(uint32))
#define MMU_L1_TABLE_SIZE (4096 * 4)
//4096 entries (one entry per MB) -> 16KB
#define MMU_L2_COARSE_TABLE_SIZE (256 * 4)
//256 entries (one entry per 4KB) -> 1KB
#define ARM_MMU_L2_COARSE_ENTRY_COUNT 256
#define ARM_MMU_L2_COARSE_TABLE_SIZE (ARM_MMU_L2_COARSE_ENTRY_COUNT \
* sizeof(uint32))
#define ARM_MMU_L2_FINE_ENTRY_COUNT 1024
#define ARM_MMU_L2_FINE_TABLE_SIZE (ARM_MMU_L2_FINE_ENTRY_COUNT \
* sizeof(uint32))
/*
* definitions for CP15 r1
*/
#define CR_R1_MMU 0x1 // enable MMU
#define CP_R1_XP 0x800000 // if XP=0 then use backwards comaptible
// translation tables
#define CR_R1_MMU 0x1 // enable MMU
#define CP_R1_XP 0x800000
// if XP=0 then use backwards comaptible translation tables
#define VADDR_TO_PDENT(va) ((va) >> 20)
#define VADDR_TO_PTENT(va) (((va) & 0xff000) >> 12)
#define VADDR_TO_PGOFF(va) ((va) & 0x0fff)
#define ARM_PDE_ADDRESS_MASK 0xfffffc00
#define ARM_PTE_ADDRESS_MASK 0xfffff000
#define VADDR_TO_PDENT(va) ((va) >> 20)
#define VADDR_TO_PTENT(va) (((va) & 0xff000) >> 12)
#define VADDR_TO_PGOFF(va) ((va) & 0x0fff)
#define ARM_PDE_ADDRESS_MASK 0xfffffc00
#define ARM_PDE_TYPE_MASK 0x00000003
#define ARM_PTE_ADDRESS_MASK 0xfffff000
#define ARM_PTE_TYPE_MASK 0x00000003
#endif /* _ARCH_ARM_ARM_MMU_H */
@@ -46,9 +46,10 @@ status_t vesa_set_dpms_mode(uint32 dpmsFlags);
// cursor
status_t vesa_set_cursor_shape(uint16 width, uint16 height, uint16 hotX,
uint16 hotY, uint8 *andMask, uint8 *xorMask);
uint16 hotY, const uint8 *andMask, const uint8 *xorMask);
status_t vesa_set_cursor_bitmap(uint16 width, uint16 height, uint16 hotX,
uint16 hotY, uint32 colorSpace, uint16 bytesPerRow, uint8* bitmapData);
uint16 hotY, color_space colorSpace, uint16 bytesPerRow,
const uint8* bitmapData);
void vesa_move_cursor(uint16 x, uint16 y);
void vesa_show_cursor(bool is_visible);
@@ -33,11 +33,21 @@
# define TRACE(x) ;
#endif
#ifdef _USER_MODE
# define ERROR(x) printf x
#else
# define ERROR(x) dprintf x
#endif
using std::nothrow;
// Maximal number of logical partitions per extended partition we allow.
static const int32 kMaxLogicalPartitionCount = 128;
// Constants used to verify if a disk uses a GPT
static const int32 kGPTSignatureSize = 8;
static const char kGPTSignature[8] = { 'E', 'F', 'I', ' ', 'P', 'A', 'R', 'T' };
// constructor
PartitionMapParser::PartitionMapParser(int deviceFD, off_t sessionOffset,
@@ -295,20 +305,32 @@ PartitionMapParser::_ReadPartitionTable(off_t offset, partition_table* table)
if (table == NULL)
table = fPartitionTable;
status_t error = B_OK;
// read
if (read_pos(fDeviceFD, fSessionOffset + offset, table, toRead) != toRead) {
#ifndef _BOOT_MODE
error = errno;
if (error == B_OK)
error = B_IO_ERROR;
#else
error = B_IO_ERROR;
#endif
TRACE(("intel: _ReadPartitionTable(): reading the partition table "
"failed: %lx\n", error));
// Read the partition table from the device into the table structure
ssize_t bytesRead = read_pos(fDeviceFD, fSessionOffset + offset,
table, toRead);
if (bytesRead != (ssize_t)toRead) {
TRACE(("intel: _ReadPartitionTable(): reading the partition "
"table failed: %lx\n", errno));
return bytesRead < 0 ? errno : B_IO_ERROR;
}
return error;
// check for GPT signature "EFI PART"
// located in the 8bytes following the mbr
toRead = kGPTSignatureSize;
char gptSignature[8];
bytesRead = read_pos(fDeviceFD, fSessionOffset + offset
+ sizeof(partition_table), &gptSignature, toRead);
if (bytesRead != (ssize_t)toRead) {
TRACE(("intel: _ReadPartitionTable(): checking for GPT "
"signature failed: %lx\n", errno));
return bytesRead < 0 ? errno : B_IO_ERROR;
}
if (memcmp(gptSignature, kGPTSignature, kGPTSignatureSize) == 0) {
ERROR(("Error: Disk is GPT-formatted: "
"GPT disks are currently unsupported.\n"));
return B_BAD_DATA;
}
return B_OK;
}
+80 -35
View File
@@ -48,27 +48,29 @@ extern "C" {
#define ERROR(x...) printf("GalliumContext: " x)
#if 0
static void
hgl_viewport(struct gl_context* glctx, GLint x, GLint y,
hgl_viewport(struct gl_context* glContext, GLint x, GLint y,
GLsizei width, GLsizei height)
{
TRACE("%s(glctx: %p, x: %d, y: %d, width: %d, height: %d\n",
__FUNCTION__, glctx, x, y, width, height);
struct hgl_context *context = (struct hgl_context*)glctx->DriverCtx;
TRACE("%s(glContext: %p, x: %d, y: %d, width: %d, height: %d\n", __func__,
glContext, x, y, width, height);
struct hgl_context *context = (struct hgl_context*)glContext->DriverCtx;
int32 w, h;
get_bitmap_size(context->bitmap, &w, &h);
int32 bitmapWidth;
int32 bitmapHeight;
#if 0
// TODO: mesa_resize_framebuffer? Need to investigate where this went
if (context->draw)
st_resize_framebuffer(context->draw->stfb, w, h);
if (context->read)
st_resize_framebuffer(context->read->stfb, w, h);
#endif
get_bitmap_size(context->bitmap, &bitmapWidth, &bitmapHeight);
if (width != bitmapWidth || height != bitmapHeight) {
struct gl_framebuffer *draw = glContext->WinSysDrawBuffer;
struct gl_framebuffer *read = glContext->WinSysReadBuffer;
if (draw)
_mesa_resize_framebuffer(glContext, draw, bitmapWidth, bitmapHeight);
if (read)
_mesa_resize_framebuffer(glContext, read, bitmapWidth, bitmapHeight);
}
}
#endif
static void
@@ -233,7 +235,7 @@ GalliumContext::CreateContext(Bitmap *bitmap)
return 0;
}
// Set up the initial things out context needs
// Set up the initial things our context needs
context->bitmap = bitmap;
context->colorSpace = get_bitmap_color_space(bitmap);
context->draw = NULL;
@@ -293,6 +295,15 @@ GalliumContext::CreateContext(Bitmap *bitmap)
struct st_visual stVisual;
hgl_fill_st_visual(&stVisual, glVisual);
context->draw = new GalliumFramebuffer(&stVisual);
context->read = new GalliumFramebuffer(&stVisual);
if (!context->draw || !context->read) {
ERROR("%s: Problem allocating framebuffer!\n", __func__);
_mesa_destroy_visual(glVisual);
return -1;
}
// We need to assign the screen *before* calling st_api create_context
context->manager->screen = fScreen;
@@ -344,12 +355,16 @@ GalliumContext::CreateContext(Bitmap *bitmap)
return -1;
}
// Init Gallium3D Post Processing
context->postProcess = pp_init(fScreen, context->postProcessEnable);
assert(!context->st->st_manager_private);
context->st->st_manager_private = (void*)context;
// TODO!
//context->st->ctx->DriverCtx = context;
//context->st->ctx->Driver.Viewport = hgl_viewport;
struct st_context *stContext = (struct st_context*)context->st;
stContext->ctx->DriverCtx = context;
stContext->ctx->Driver.Viewport = hgl_viewport;
// TODO: Closely review this next context logic...
context_id contextNext = -1;
@@ -394,6 +409,15 @@ GalliumContext::DestroyContext(context_id contextID)
fContext[contextID]->st->destroy(fContext[contextID]->st);
}
if (fContext[contextID]->postProcess)
pp_free(fContext[contextID]->postProcess);
// Delete framebuffer objects
if (fContext[contextID]->read)
delete fContext[contextID]->read;
if (fContext[contextID]->draw)
delete fContext[contextID]->draw;
if (fContext[contextID]->manager)
FREE(fContext[contextID]->manager);
@@ -437,11 +461,20 @@ GalliumContext::SetCurrentContext(Bitmap *bitmap, context_id contextID)
ST_FLUSH_FRONT, NULL);
}
// TODO: WinSysDrawBuffer & WinSysReadBuffer?
api->make_current(context->api, context->st, context->read, context->draw);
// We need to lock and unlock framebuffers before accessing them
context->draw->Lock();
context->read->Lock();
api->make_current(context->api, context->st, context->draw->fBuffer,
context->read->fBuffer);
context->draw->Unlock();
context->read->Unlock();
// TODO: Anything else? st_api_make_current
// TODO: Init textures before post-processing them
#if 0
pp_init_fbos(context->postProcess,
context->textures[ST_ATTACHMENT_BACK_LEFT]->width0,
context->textures[ST_ATTACHMENT_BACK_LEFT]->height0);
#endif
context->bitmap = bitmap;
//context->st->pipe->priv = context;
@@ -464,23 +497,35 @@ GalliumContext::SwapBuffers(context_id contextID)
return B_ERROR;
}
//pipe_mutex_lock(context->draw->mutex);
// TODO: Where did st_notify_swapbuffers go?
//st_notify_swapbuffers(context->draw->stfb);
// TODO: Where did st_get_framebuffer_surface go?
//struct pipe_surface *surface;
//st_get_framebuffer_surface(context->draw->stfb, ST_SURFACE_BACK_LEFT,
// &surface);
context->st->flush(context->st, ST_FLUSH_FRONT, NULL);
// TODO: Flush the frontbuffer!
//hsp_dev->hsp_winsys->flush_frontbuffer(hsp_dev->screen, surface,
// context->bitmap);
struct st_context *stContext = (struct st_context*)context->st;
//pipe_mutex_unlock(context->draw->mutex);
unsigned nColorBuffers = stContext->state.framebuffer.nr_cbufs;
for (unsigned i = 0; i < nColorBuffers; i++) {
pipe_surface* surface = stContext->state.framebuffer.cbufs[i];
if (!surface) {
ERROR("%s: Color buffer %d invalid!\n", __func__, i);
continue;
}
return true;
TRACE("%s: Flushing color buffer #%d\n", __func__, i);
// We pass our destination bitmap to flush_fronbuffer which passes it
// to the private winsys display call.
fScreen->flush_frontbuffer(fScreen, surface->texture, 0, 0,
context->bitmap);
}
#if 0
// TODO... should we flush the z stencil buffer?
pipe_surface* zSurface = stContext->state.framebuffer.zsbuf;
fScreen->flush_frontbuffer(fScreen, surface->texture, 0, 0,
context->bitmap);
#endif
return B_OK;
}
+12 -3
View File
@@ -13,10 +13,11 @@ extern "C" {
#include "state_tracker/st_api.h"
#include "pipe/p_compiler.h"
#include "pipe/p_screen.h"
#include "postprocess/filters.h"
#include "os/os_thread.h"
}
#include "bitmap_wrapper.h"
#include "GalliumFramebuffer.h"
#define CONTEXT_MAX 32
@@ -37,12 +38,20 @@ struct hgl_context
// State Tracker Manager
struct st_context_iface* st;
// State Tracker Interface Object
struct st_visual* stVisual;
// State Tracker Visual
struct pipe_resource* textures[ST_ATTACHMENT_COUNT];
// Post processing
struct pp_queue_t* postProcess;
unsigned int postProcessEnable[PP_FILTERS];
Bitmap* bitmap;
color_space colorSpace;
struct st_framebuffer_iface* draw;
struct st_framebuffer_iface* read;
GalliumFramebuffer* draw;
GalliumFramebuffer* read;
};
@@ -0,0 +1,113 @@
/*
* Copyright 2012, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Artur Wyszynski, [email protected]
* Alexander von Gluck IV, [email protected]
*/
#include "GalliumFramebuffer.h"
extern "C" {
#include "main/context.h"
#include "main/framebuffer.h"
#include "main/renderbuffer.h"
#include "pipe/p_format.h"
}
#define TRACE_FRAMEBUFFER
#ifdef TRACE_FRAEMBUFFER
# define TRACE(x...) printf("GalliumFramebuffer: " x)
# define CALLED() TRACE("CALLED: %s\n", __PRETTY_FUNCTION__)
#else
# define TRACE(x...)
# define CALLED()
#endif
#define ERROR(x...) printf("GalliumFramebuffer: " x)
static boolean
hgl_framebuffer_flush_front(struct st_framebuffer_iface* stfb,
enum st_attachment_type statt)
{
CALLED();
// TODO: I have *NO* idea how we are going to access this data...
#if 0
struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
pipe_mutex_lock(stwfb->fb->mutex);
struct pipe_resource* resource = textures[statt];
if (resource)
stw_framebuffer_present_locked(...);
#endif
return TRUE;
}
static boolean
hgl_framebuffer_validate(struct st_framebuffer_iface* stfb,
const enum st_attachment_type* statts, unsigned count,
struct pipe_resource** out)
{
CALLED();
return TRUE;
}
GalliumFramebuffer::GalliumFramebuffer(struct st_visual* visual)
:
fBuffer(NULL)
{
CALLED();
fBuffer = CALLOC_STRUCT(st_framebuffer_iface);
if (!fBuffer) {
ERROR("%s: Couldn't calloc framebuffer!\n", __func__);
return;
}
fBuffer->visual = visual;
fBuffer->flush_front = hgl_framebuffer_flush_front;
fBuffer->validate = hgl_framebuffer_validate;
pipe_mutex_init(fMutex);
}
GalliumFramebuffer::~GalliumFramebuffer()
{
CALLED();
// We lock and unlock to try and make sure we wait for anything
// using the framebuffer to finish
Lock();
if (!fBuffer) {
ERROR("%s: Strange, no Gallium Framebuffer to free?\n", __func__);
return;
}
FREE(fBuffer);
Unlock();
pipe_mutex_destroy(fMutex);
}
status_t
GalliumFramebuffer::Lock()
{
CALLED();
pipe_mutex_lock(fMutex);
return B_OK;
}
status_t
GalliumFramebuffer::Unlock()
{
CALLED();
pipe_mutex_unlock(fMutex);
return B_OK;
}
@@ -0,0 +1,33 @@
/*
* Copyright 2012, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Alexander von Gluck IV, [email protected]
*/
#ifndef GALLIUMFRAMEBUFFER_H
#define GALLIUMFRAMEBUFFER_H
extern "C" {
#include "os/os_thread.h"
#include "pipe/p_screen.h"
#include "state_tracker/st_api.h"
}
class GalliumFramebuffer {
public:
GalliumFramebuffer(struct st_visual* visual);
~GalliumFramebuffer();
status_t Lock();
status_t Unlock();
struct st_framebuffer_iface* fBuffer;
private:
pipe_mutex fMutex;
};
#endif /* GALLIUMFRAMEBUFFER_H */
+8
View File
@@ -10,8 +10,16 @@ local sources =
SoftwareRenderer.cpp
SoftwareWinsys.cpp
GalliumContext.cpp
GalliumFramebuffer.cpp
bitmap_wrapper.cpp ;
if $(HAIKU_LLVM_PRESENT) {
# TODO: Add LLVM OptionalBuildPackage
SubDirC++Flags [ FDefines USE_LLVMPIPE ] ;
SubDirSysHdrs $(HAIKU_LLVM_HEADERS) ;
}
UsePrivateHeaders interface ;
SubDirSysHdrs $(HAIKU_MESA_HEADERS) ;
Includes [ FGristFiles $(sources) ] : $(HAIKU_MESA_HEADERS_DEPENDENCY) ;
+11 -5
View File
@@ -169,12 +169,18 @@ hook_winsys_displaytarget_display(struct sw_winsys* winsys,
{
CALLED();
//struct haiku_displaytarget* haikuDisplayTarget
// = cast_haiku_displaytarget(displayTarget);
if (!contextPrivate) {
ERROR("%s: Passed invalid private pointer!\n", __func__);
return;
}
// GDI copies data from haikuDisplayTarget->data into
// a Bitmap casted from contextPrivate.. need to investigate
// this.
Bitmap* bitmap = (Bitmap*)contextPrivate;
struct haiku_displaytarget* haikuDisplayTarget
= cast_haiku_displaytarget(displayTarget);
copy_bitmap_bits(bitmap, haikuDisplayTarget->data,
haikuDisplayTarget->size);
return;
}
+16 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2005-2011, Haiku, Inc.
* Copyright 2005-2012, Haiku, Inc.
* Distributed under the terms of the MIT license.
*
* Authors:
@@ -46,6 +46,7 @@
#include <AppMisc.h>
#include <AutoDeleter.h>
#include <cpu_type.h>
#include <parsedate.h>
#include <system_revision.h>
#include <Catalog.h>
@@ -662,10 +663,21 @@ AboutView::AboutView()
B_ALIGN_VERTICAL_UNSET));
// Kernel build time/date
snprintf(string, sizeof(string), "%s %s",
systemInfo.kernel_build_date, systemInfo.kernel_build_time);
BString kernelTimeDate;
kernelTimeDate << systemInfo.kernel_build_date
<< " " << systemInfo.kernel_build_time;
BString buildTimeDate;
const BLocale* locale = BLocale::Default();
BStringView* kernelView = new BStringView("kerneltext", string);
time_t buildTimeDateStamp = parsedate(kernelTimeDate, -1);
if (buildTimeDateStamp > 0) {
if (locale->FormatDateTime(&buildTimeDate, buildTimeDateStamp,
B_LONG_DATE_FORMAT, B_MEDIUM_TIME_FORMAT) != B_OK)
buildTimeDate.SetTo(kernelTimeDate);
} else
buildTimeDate.SetTo(kernelTimeDate);
BStringView* kernelView = new BStringView("kerneltext", buildTimeDate);
kernelView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
B_ALIGN_VERTICAL_UNSET));
+1 -1
View File
@@ -48,7 +48,7 @@ public:
interval /= 1000;
// Find closest index
int32 bestDiff = LONG_MAX;
int32 bestDiff = INT32_MAX;
uint32 bestIndex = 0;
for (uint32 i = 0; i < kNumUpdateIntervals; i++) {
int32 diff = abs(kUpdateIntervals[i] - interval);
+2
View File
@@ -265,6 +265,7 @@ Application Debugger :
ValueNodeContainer.cpp
# value/type_handlers
BListTypeHandler.cpp
BMessageTypeHandler.cpp
CStringTypeHandler.cpp
@@ -279,6 +280,7 @@ Application Debugger :
# value/value_nodes
AddressValueNode.cpp
ArrayValueNode.cpp
BListValueNode.cpp
BMessageValueNode.cpp
CompoundValueNode.cpp
CStringValueNode.cpp
+27 -15
View File
@@ -309,25 +309,37 @@ ArchitectureX86::CreateStackFrame(Image* image, FunctionDebugInfo* function,
// If the function is not frameless and we're at the top frame we need
// to check whether the prologue has not been executed (completely) or
// we're already after the epilogue.
if (hasPrologue && isTopFrame) {
if (isTopFrame) {
uint32 stack = 0;
if (eip < function->Address() + 3) {
// The prologue has not been executed yet, i.e. there's no
// stack frame yet. Get the return address from the stack.
stack = cpuState->IntRegisterValue(X86_REGISTER_ESP);
if (eip > function->Address()) {
// The "push %ebp" has already been executed.
stack += 4;
if (hasPrologue) {
if (eip < function->Address() + 3) {
// The prologue has not been executed yet, i.e. there's no
// stack frame yet. Get the return address from the stack.
stack = cpuState->IntRegisterValue(X86_REGISTER_ESP);
if (eip > function->Address()) {
// The "push %ebp" has already been executed.
stack += 4;
}
} else {
// Not in the function prologue, but maybe after the
// epilogue. The epilogue is a single "pop %ebp", so we
// check whether the current instruction is already a
// "ret".
uint8 code[1];
if (fTeamMemory->ReadMemory(eip, &code, 1) == 1
&& code[0] == 0xc3) {
stack = cpuState->IntRegisterValue(X86_REGISTER_ESP);
}
}
} else {
// Not in the function prologue, but maybe after the epilogue.
// The epilogue is a single "pop %ebp", so we check whether the
// current instruction is already a "ret".
uint8 code[1];
if (fTeamMemory->ReadMemory(eip, &code, 1) == 1
&& code[0] == 0xc3) {
// Check if the instruction pointer is at a readable location.
// If it isn't, then chances are we got here via a bogus
// function pointer, and the prologue hasn't actually been
// executed. In such a case, what we need is right at the top
// of the stack.
uint8 data[1];
if (fTeamMemory->ReadMemory(eip, &data, 1) != 1)
stack = cpuState->IntRegisterValue(X86_REGISTER_ESP);
}
}
if (stack != 0) {
@@ -417,8 +417,15 @@ DwarfImageDebugInfo::GetType(GlobalTypeCache* cache,
BReference<RegisterMap> fromDwarfMapReference(fromDwarfMap, true);
// create the target interface
BasicTargetInterface inputInterface(registers, registerCount, fromDwarfMap,
fArchitecture, fTeamMemory);
BasicTargetInterface *inputInterface
= new(std::nothrow) BasicTargetInterface(registers, registerCount,
fromDwarfMap, fArchitecture, fTeamMemory);
if (inputInterface == NULL)
return B_NO_MEMORY;
BReference<BasicTargetInterface> inputInterfaceReference(inputInterface,
true);
// iterate through all compilation units
for (int32 i = 0; CompilationUnit* unit = fFile->CompilationUnitAt(i);
@@ -458,7 +465,7 @@ DwarfImageDebugInfo::GetType(GlobalTypeCache* cache,
if (typeContext == NULL) {
typeContext = new(std::nothrow)
DwarfTypeContext(fArchitecture, fImageInfo.ImageID(), fFile,
unit, NULL, 0, 0, fRelocationDelta, &inputInterface,
unit, NULL, 0, 0, fRelocationDelta, inputInterface,
fromDwarfMap);
if (typeContext == NULL)
return B_NO_MEMORY;
@@ -1080,8 +1087,8 @@ DwarfImageDebugInfo::_EvaluateBaseTypeConstraints(DIEType* type,
if (baseTypeOwnerEntry != NULL) {
DwarfUtils::GetFullyQualifiedDIEName(baseTypeOwnerEntry,
baseEntryName);
if (!baseEntryName.IsEmpty() && baseEntryName
!= constraints.BaseTypeName())
if (baseEntryName != constraints.BaseTypeName())
return false;
}
}
@@ -102,6 +102,17 @@ struct HasBaseTypesPredicate {
};
// #pragma mark - HasTemplateParametersPredicate
struct HasTemplateParametersPredicate {
inline bool operator()(DIEClassBaseType* entry) const
{
return !entry->TemplateParameters().IsEmpty();
}
};
// #pragma mark - HasParametersPredicate
@@ -516,7 +527,7 @@ printf(" -> failed to add type to cache\n");
}
// If the type is a class/struct/interface type, we also need to add its
// base types.
// base types, and possibly template parameters.
if (DIEClassBaseType* classTypeEntry
= dynamic_cast<DIEClassBaseType*>(typeEntry)) {
// find the abstract origin or specification that defines the base types
@@ -549,6 +560,52 @@ printf(" -> failed to add type to cache\n");
}
}
}
// find the abstract origin or specification that defines the template
// parameters
classTypeEntry = DwarfUtils::GetDIEByPredicate(
dynamic_cast<DIEClassBaseType*>(typeEntry),
HasTemplateParametersPredicate());
if (classTypeEntry != NULL) {
for (DebugInfoEntryList::ConstIterator it
= classTypeEntry->TemplateParameters()
.GetIterator();
DebugInfoEntry* _typeEntry = it.Next();) {
DIETemplateTypeParameter* templateTypeEntry
= dynamic_cast<DIETemplateTypeParameter*>(_typeEntry);
DwarfType* templateType;
if (templateTypeEntry != NULL) {
if (CreateType(templateTypeEntry->GetType(), templateType)
!= B_OK) {
continue;
}
} else {
DIETemplateValueParameter* templateValueEntry
= dynamic_cast<DIETemplateValueParameter*>(_typeEntry);
if (CreateType(templateValueEntry->GetType(), templateType)
!= B_OK) {
continue;
}
}
BReference<DwarfType> templateTypeReference(templateType,
true);
DwarfTemplateParameter* parameter
= new(std::nothrow) DwarfTemplateParameter(_typeEntry,
templateType);
if (parameter == NULL) {
cacheLocker.Lock();
fTypeCache->RemoveType(type);
return B_NO_MEMORY;
}
if (!type->AddTemplateParameter(parameter)) {
cacheLocker.Lock();
fTypeCache->RemoveType(type);
return B_NO_MEMORY;
}
}
}
}
_type = typeReference.Detach();
@@ -518,6 +518,45 @@ DwarfFunctionParameter::GetType() const
}
// #pragma mark - DwarfTemplateParameter
DwarfTemplateParameter::DwarfTemplateParameter(DebugInfoEntry* entry,
DwarfType* type)
:
fEntry(entry),
fType(type)
{
fType->AcquireReference();
DIETemplateTypeParameter* typeParameter
= dynamic_cast<DIETemplateTypeParameter *>(entry);
if (typeParameter != NULL)
fTemplateKind = TEMPLATE_TYPE_TYPE;
else {
DIETemplateValueParameter* valueParameter
= dynamic_cast<DIETemplateValueParameter *>(entry);
fTemplateKind = TEMPLATE_TYPE_VALUE;
const ConstantAttributeValue* constValue = valueParameter
->ConstValue();
switch (constValue->attributeClass) {
case ATTRIBUTE_CLASS_CONSTANT:
fValue.SetTo(constValue->constant);
break;
case ATTRIBUTE_CLASS_STRING:
fValue.SetTo(constValue->string);
break;
// TODO: ATTRIBUTE_CLASS_BLOCK_DATA
}
}
}
DwarfTemplateParameter::~DwarfTemplateParameter()
{
fType->ReleaseReference();
}
// #pragma mark - DwarfPrimitiveType
@@ -567,6 +606,11 @@ DwarfCompoundType::~DwarfCompoundType()
}
for (int32 i = 0; DwarfDataMember* member = fDataMembers.ItemAt(i); i++)
member->ReleaseReference();
for (int32 i = 0; DwarfTemplateParameter* parameter
= fTemplateParameters.ItemAt(i); i++) {
parameter->ReleaseReference();
}
}
@@ -605,6 +649,20 @@ DwarfCompoundType::DataMemberAt(int32 index) const
}
int32
DwarfCompoundType::CountTemplateParameters() const
{
return fTemplateParameters.CountItems();
}
TemplateParameter*
DwarfCompoundType::TemplateParameterAt(int32 index) const
{
return fTemplateParameters.ItemAt(index);
}
status_t
DwarfCompoundType::ResolveBaseTypeLocation(BaseType* _baseType,
const ValueLocation& parentLocation, ValueLocation*& _location)
@@ -736,6 +794,17 @@ DwarfCompoundType::AddDataMember(DwarfDataMember* member)
}
bool
DwarfCompoundType::AddTemplateParameter(DwarfTemplateParameter* parameter)
{
if (!fTemplateParameters.AddItem(parameter))
return false;
parameter->AcquireReference();
return true;
}
status_t
DwarfCompoundType::_ResolveDataMemberLocation(DwarfType* memberType,
const MemberLocation* memberLocation,
+27
View File
@@ -17,6 +17,7 @@
class Architecture;
class CompilationUnit;
class DebugInfoEntry;
class DIEAddressingType;
class DIEArrayType;
class DIEBaseType;
@@ -237,6 +238,25 @@ private:
};
class DwarfTemplateParameter : public TemplateParameter {
public:
DwarfTemplateParameter(
DebugInfoEntry* entry,
DwarfType* type);
~DwarfTemplateParameter();
virtual template_type_kind Kind() const { return fTemplateKind; }
virtual Type* GetType() const { return fType; }
virtual BVariant Value() const { return fValue; }
private:
DebugInfoEntry* fEntry;
template_type_kind fTemplateKind;
Type* fType;
BVariant fValue;
};
class DwarfPrimitiveType : public PrimitiveType, public DwarfType {
public:
DwarfPrimitiveType(
@@ -271,6 +291,9 @@ public:
virtual int32 CountDataMembers() const;
virtual DataMember* DataMemberAt(int32 index) const;
virtual int32 CountTemplateParameters() const;
virtual TemplateParameter* TemplateParameterAt(int32 index) const;
virtual status_t ResolveBaseTypeLocation(BaseType* _baseType,
const ValueLocation& parentLocation,
ValueLocation*& _location);
@@ -285,10 +308,13 @@ public:
bool AddInheritance(DwarfInheritance* inheritance);
bool AddDataMember(DwarfDataMember* member);
bool AddTemplateParameter(
DwarfTemplateParameter* parameter);
private:
typedef BObjectList<DwarfDataMember> DataMemberList;
typedef BObjectList<DwarfInheritance> InheritanceList;
typedef BObjectList<DwarfTemplateParameter> TemplateParameterList;
private:
status_t _ResolveDataMemberLocation(
@@ -302,6 +328,7 @@ private:
DIECompoundType* fEntry;
InheritanceList fInheritances;
DataMemberList fDataMembers;
TemplateParameterList fTemplateParameters;
};
+4 -1
View File
@@ -477,7 +477,10 @@ DIEClassBaseType::AddChild(DebugInfoEntry* child)
case DW_TAG_subprogram:
fMemberFunctions.Add(child);
return B_OK;
// TODO: Templates!
case DW_TAG_template_type_parameter:
case DW_TAG_template_value_parameter:
fTemplateParameters.Add(child);
return B_OK;
// TODO: Variants!
default:
{
@@ -353,6 +353,8 @@ public:
const DebugInfoEntryList& BaseTypes() const
{ return fBaseTypes; }
const DebugInfoEntryList& TemplateParameters() const
{ return fTemplateParameters; }
virtual status_t AddChild(DebugInfoEntry* child);
@@ -362,6 +364,7 @@ protected:
DebugInfoEntryList fAccessDeclarations;
DebugInfoEntryList fMemberFunctions;
DebugInfoEntryList fInnerTypes;
DebugInfoEntryList fTemplateParameters;
};
+8
View File
@@ -72,6 +72,14 @@ FunctionParameter::~FunctionParameter()
}
// #pragma mark - TemplateParameter
TemplateParameter::~TemplateParameter()
{
}
// #pragma mark - Type
+20
View File
@@ -43,6 +43,12 @@ enum address_type_kind {
};
enum template_type_kind {
TEMPLATE_TYPE_TYPE,
TEMPLATE_TYPE_VALUE
};
enum {
TYPE_MODIFIER_CONST = 0x01,
TYPE_MODIFIER_VOLATILE = 0x02,
@@ -105,6 +111,16 @@ public:
};
class TemplateParameter : public BReferenceable {
public:
virtual ~TemplateParameter();
virtual template_type_kind Kind() const = 0;
virtual Type* GetType() const = 0;
virtual BVariant Value() const = 0;
};
class Type : public BReferenceable {
public:
virtual ~Type();
@@ -158,6 +174,10 @@ public:
virtual int32 CountDataMembers() const = 0;
virtual DataMember* DataMemberAt(int32 index) const = 0;
virtual int32 CountTemplateParameters() const = 0;
virtual TemplateParameter* TemplateParameterAt(int32 index) const = 0;
virtual status_t ResolveBaseTypeLocation(BaseType* baseType,
const ValueLocation& parentLocation,
ValueLocation*& _location) = 0;
@@ -1030,6 +1030,18 @@ VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node)
if (modelNode == NULL)
return;
// in the case of an address node with a hidden child,
// we want to send removal notifications for the children
// instead.
BReference<ModelNode> hiddenChild;
if (modelNode->CountChildren() == 1
&& modelNode->ChildAt(0)->IsHidden()) {
hiddenChild.SetTo(modelNode->ChildAt(0));
modelNode->RemoveChild(hiddenChild);
modelNode = hiddenChild;
fNodeTable.Remove(hiddenChild);
}
for (int32 i = 0; i < modelNode->CountChildren(); i++) {
BReference<ModelNode> childNode = modelNode->ChildAt(i);
TreeTablePath treePath;
@@ -1776,8 +1788,10 @@ VariablesView::MessageReceived(BMessage* message)
case MSG_MODEL_NODE_HIDDEN:
{
ModelNode* node;
if (message->FindPointer("node", (void**)&node) == B_OK)
if (message->FindPointer("node", (void**)&node) == B_OK) {
BReference<ModelNode> modelNodeReference(node, true);
_RequestNodeValue(node);
}
break;
}
@@ -14,6 +14,7 @@
#include "AddressValueNode.h"
#include "ArrayValueNode.h"
#include "CompoundValueNode.h"
#include "BListTypeHandler.h"
#include "BMessageTypeHandler.h"
#include "CStringTypeHandler.h"
#include "EnumerationValueNode.h"
@@ -152,6 +153,7 @@ TypeHandlerRoster::RegisterDefaultHandlers()
REGISTER_SPECIALIZED_HANDLER(CString);
REGISTER_SPECIALIZED_HANDLER(BMessage);
REGISTER_SPECIALIZED_HANDLER(BList);
return B_OK;
}
@@ -0,0 +1,48 @@
/*
* Copyright 2012, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#include "BListTypeHandler.h"
#include <new>
#include "BListValueNode.h"
#include "Type.h"
BListTypeHandler::~BListTypeHandler()
{
}
float
BListTypeHandler::SupportsType(Type* type)
{
if (dynamic_cast<CompoundType*>(type) != NULL
&& (type->Name() == "BList"
|| type->Name().Compare("BObjectList", 11) == 0))
return 1.0f;
return 0.0f;
}
status_t
BListTypeHandler::CreateValueNode(ValueNodeChild* nodeChild, Type* type,
ValueNode*& _node)
{
if (SupportsType(type) == 0.0f)
return B_BAD_VALUE;
ValueNode* node = new(std::nothrow) BListValueNode(nodeChild,
type);
if (node == NULL)
return B_NO_MEMORY;
_node = node;
return B_OK;
}
@@ -0,0 +1,21 @@
/*
* Copyright 2012, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#ifndef BLIST_TYPE_HANDLER_H
#define BLIST_TYPE_HANDLER_H
#include "TypeHandler.h"
class BListTypeHandler : public TypeHandler {
public:
virtual ~BListTypeHandler();
virtual float SupportsType(Type* type);
virtual status_t CreateValueNode(ValueNodeChild* nodeChild,
Type* type, ValueNode*& _node);
};
#endif // BLIST_TYPE_HANDLER_H
@@ -0,0 +1,375 @@
/*
* Copyright 2012, Rene Gollent, rene@gollent.com
* Distributed under the terms of the MIT License.
*/
#include "BListValueNode.h"
#include <new>
#include <AutoDeleter.h>
#include "AddressValueNode.h"
#include "Architecture.h"
#include "StringValue.h"
#include "Tracing.h"
#include "Type.h"
#include "TypeLookupConstraints.h"
#include "ValueLoader.h"
#include "ValueLocation.h"
#include "ValueNodeContainer.h"
// maximum number of array elements to show by default
static const int64 kMaxArrayElementCount = 20;
//#pragma mark - BListValueNode::BListElementNodeChild
class BListValueNode::BListElementNodeChild : public ValueNodeChild {
public:
BListElementNodeChild(BListValueNode* parent,
int64 elementIndex, Type* type);
virtual ~BListElementNodeChild();
virtual const BString& Name() const { return fName; };
virtual Type* GetType() const { return fType; };
virtual ValueNode* Parent() const { return fParent; };
virtual status_t ResolveLocation(ValueLoader* valueLoader,
ValueLocation*& _location);
private:
Type* fType;
BListValueNode* fParent;
int64 fElementIndex;
BString fName;
};
BListValueNode::BListElementNodeChild::BListElementNodeChild(
BListValueNode* parent, int64 elementIndex, Type* type)
:
ValueNodeChild(),
fType(type),
fParent(parent),
fElementIndex(elementIndex),
fName()
{
fType->AcquireReference();
fParent->AcquireReference();
fName.SetToFormat("[%" B_PRId64 "]", fElementIndex);
}
BListValueNode::BListElementNodeChild::~BListElementNodeChild()
{
fType->ReleaseReference();
fParent->ReleaseReference();
}
status_t
BListValueNode::BListElementNodeChild::ResolveLocation(
ValueLoader* valueLoader, ValueLocation*& _location)
{
uint8 addressSize = valueLoader->GetArchitecture()->AddressSize();
ValueLocation* location = new(std::nothrow) ValueLocation();
if (location == NULL)
return B_NO_MEMORY;
uint64 listAddress = fParent->fDataLocation.ToUInt64();
listAddress += fElementIndex * addressSize;
ValuePieceLocation piece;
piece.SetToMemory(listAddress);
piece.SetSize(addressSize);
location->AddPiece(piece);
_location = location;
return B_OK;
}
//#pragma mark - BListItemCountNodeChild
class BListValueNode::BListItemCountNodeChild : public ValueNodeChild {
public:
BListItemCountNodeChild(BVariant location,
BListValueNode* parent, Type* type);
virtual ~BListItemCountNodeChild();
virtual const BString& Name() const { return fName; };
virtual Type* GetType() const { return fType; };
virtual ValueNode* Parent() const { return fParent; };
virtual status_t ResolveLocation(ValueLoader* valueLoader,
ValueLocation*& _location);
private:
Type* fType;
BListValueNode* fParent;
BVariant fLocation;
BString fName;
};
BListValueNode::BListItemCountNodeChild::BListItemCountNodeChild(
BVariant location, BListValueNode* parent, Type* type)
:
ValueNodeChild(),
fType(type),
fParent(parent),
fLocation(location),
fName("Capacity")
{
fType->AcquireReference();
fParent->AcquireReference();
}
BListValueNode::BListItemCountNodeChild::~BListItemCountNodeChild()
{
fType->ReleaseReference();
fParent->ReleaseReference();
}
status_t
BListValueNode::BListItemCountNodeChild::ResolveLocation(
ValueLoader* valueLoader, ValueLocation*& _location)
{
ValueLocation* location = new(std::nothrow) ValueLocation();
if (location == NULL)
return B_NO_MEMORY;
ValuePieceLocation piece;
piece.SetToMemory(fLocation.ToUInt64());
piece.SetSize(sizeof(int32));
location->AddPiece(piece);
_location = location;
return B_OK;
}
//#pragma mark - BListValueNode
BListValueNode::BListValueNode(ValueNodeChild* nodeChild,
Type* type)
:
ValueNode(nodeChild),
fType(type),
fLoader(NULL),
fItemCountType(NULL),
fItemCount(0)
{
fType->AcquireReference();
}
BListValueNode::~BListValueNode()
{
fType->ReleaseReference();
for (int32 i = 0; i < fChildren.CountItems(); i++)
fChildren.ItemAt(i)->ReleaseReference();
if (fItemCountType != NULL)
fItemCountType->ReleaseReference();
delete fLoader;
}
Type*
BListValueNode::GetType() const
{
return fType;
}
status_t
BListValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
ValueLocation*& _location, Value*& _value)
{
// get the location
ValueLocation* location = NodeChild()->Location();
if (location == NULL)
return B_BAD_VALUE;
// get the value type
type_code valueType;
if (valueLoader->GetArchitecture()->AddressSize() == 4) {
valueType = B_UINT32_TYPE;
TRACE_LOCALS(" -> 32 bit\n");
} else {
valueType = B_UINT64_TYPE;
TRACE_LOCALS(" -> 64 bit\n");
}
// load the value data
status_t error = B_OK;
_location = location;
_value = NULL;
ValueLocation* memberLocation = NULL;
CompoundType* baseType = dynamic_cast<CompoundType*>(fType);
if (baseType->CountTemplateParameters() != 0) {
// for BObjectList we need to walk up
// the hierarchy: BObjectList -> _PointerList_ -> BList
if (baseType->CountBaseTypes() == 0)
return B_BAD_DATA;
baseType = dynamic_cast<CompoundType*>(baseType->BaseTypeAt(0)
->GetType());
if (baseType == NULL || baseType->Name() != "_PointerList_")
return B_BAD_DATA;
if (baseType->CountBaseTypes() == 0)
return B_BAD_DATA;
baseType = dynamic_cast<CompoundType*>(baseType->BaseTypeAt(0)
->GetType());
if (baseType == NULL || baseType->Name() != "BList")
return B_BAD_DATA;
}
for (int32 i = 0; i < baseType->CountDataMembers(); i++) {
DataMember* member = baseType->DataMemberAt(i);
if (strcmp(member->Name(), "fObjectList") == 0) {
error = baseType->ResolveDataMemberLocation(member,
*location, memberLocation);
if (error != B_OK) {
TRACE_LOCALS(
"BListValueNode::ResolvedLocationAndValue(): "
"failed to resolve location of header member: %s\n",
strerror(error));
delete memberLocation;
return error;
}
error = valueLoader->LoadValue(memberLocation, valueType,
false, fDataLocation);
delete memberLocation;
if (error != B_OK)
return error;
} else if (strcmp(member->Name(), "fItemCount") == 0) {
error = baseType->ResolveDataMemberLocation(member,
*location, memberLocation);
if (error != B_OK) {
TRACE_LOCALS(
"BListValueNode::ResolvedLocationAndValue(): "
"failed to resolve location of header member: %s\n",
strerror(error));
delete memberLocation;
return error;
}
fItemCountType = member->GetType();
fItemCountType->AcquireReference();
fItemCountLocation = memberLocation->PieceAt(0).address;
BVariant listSize;
error = valueLoader->LoadValue(memberLocation, valueType,
false, listSize);
delete memberLocation;
if (error != B_OK)
return error;
fItemCount = listSize.ToInt32();
TRACE_LOCALS(
"BListValueNode::ResolvedLocationAndValue(): "
"detected list size %" B_PRId32 "\n",
fItemCount);
}
memberLocation = NULL;
}
if (fLoader == NULL) {
fLoader = new(std::nothrow)ValueLoader(*valueLoader);
if (fLoader == NULL)
return B_NO_MEMORY;
}
return B_OK;
}
status_t
BListValueNode::CreateChildren()
{
if (fChildrenCreated)
return B_OK;
if (fItemCountType != NULL) {
BListItemCountNodeChild* countChild = new(std::nothrow)
BListItemCountNodeChild(fItemCountLocation, this, fItemCountType);
if (countChild == NULL)
return B_NO_MEMORY;
countChild->SetContainer(fContainer);
fChildren.AddItem(countChild);
}
BReference<Type> addressTypeRef;
Type* type = NULL;
CompoundType* objectType = dynamic_cast<CompoundType*>(fType);
if (objectType->CountTemplateParameters() != 0) {
AddressType* addressType = NULL;
status_t result = objectType->TemplateParameterAt(0)->GetType()
->CreateDerivedAddressType(DERIVED_TYPE_POINTER, addressType);
if (result != B_OK)
return result;
type = addressType;
addressTypeRef.SetTo(type, true);
} else {
BString typeName;
TypeLookupConstraints constraints;
constraints.SetTypeKind(TYPE_ADDRESS);
constraints.SetBaseTypeName("void");
status_t result = fLoader->LookupTypeByName(typeName, constraints, type);
if (result != B_OK)
return result;
}
for (int32 i = 0; i < fItemCount && i < kMaxArrayElementCount; i++)
{
BListElementNodeChild* child =
new(std::nothrow) BListElementNodeChild(this, i, type);
if (child == NULL)
return B_NO_MEMORY;
child->SetContainer(fContainer);
fChildren.AddItem(child);
}
fChildrenCreated = true;
if (fContainer != NULL)
fContainer->NotifyValueNodeChildrenCreated(this);
return B_OK;
}
int32
BListValueNode::CountChildren() const
{
return fChildren.CountItems();
}
ValueNodeChild*
BListValueNode::ChildAt(int32 index) const
{
return fChildren.ItemAt(index);
}
@@ -0,0 +1,61 @@
/*
* Copyright 2012, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#ifndef BLIST_VALUE_NODE_H
#define BLIST_VALUE_NODE_H
#include <List.h>
#include <Variant.h>
#include <ObjectList.h>
#include "ValueLocation.h"
#include "ValueNode.h"
class CompoundType;
class BListValueNode : public ValueNode {
public:
BListValueNode(ValueNodeChild* nodeChild,
Type* type);
virtual ~BListValueNode();
virtual Type* GetType() const;
virtual status_t ResolvedLocationAndValue(
ValueLoader* valueLoader,
ValueLocation*& _location,
Value*& _value);
virtual bool ChildCreationNeedsValue() const
{ return true; }
virtual status_t CreateChildren();
virtual int32 CountChildren() const;
virtual ValueNodeChild* ChildAt(int32 index) const;
private:
class BListElementNodeChild;
class BListItemCountNodeChild;
// for GCC2
friend class BListElementNodeChild;
friend class BListItemCountNodeChild;
typedef BObjectList<ValueNodeChild> ChildNodeList;
private:
Type* fType;
ChildNodeList fChildren;
ValueLoader* fLoader;
BVariant fDataLocation;
BVariant fItemCountLocation;
Type* fItemCountType;
int32 fItemCount;
};
#endif // BLIST_VALUE_NODE_H
+6
View File
@@ -221,6 +221,12 @@ PartitionListRow::PartitionListRow(BPartition* partition)
if (partition->ContainsFileSystem()) {
SetField(new BStringField(partition->ContentType()), kFilesystemColumn);
SetField(new BStringField(partition->ContentName()), kVolumeNameColumn);
} else if (partition->IsDevice()) {
if (partition->Name() != NULL && partition->Name()[0])
SetField(new BStringField(partition->Name()), kVolumeNameColumn);
else
SetField(new BStringField(kUnavailableString), kVolumeNameColumn);
SetField(new BStringField(kUnavailableString), kFilesystemColumn);
} else if (partition->CountChildren() > 0) {
SetField(new BStringField(kUnavailableString), kFilesystemColumn);
SetField(new BStringField(kUnavailableString), kVolumeNameColumn);
+32 -11
View File
@@ -150,21 +150,42 @@ ExpanderWindow::ValidateDest()
BVolume volume;
if (!entry.Exists()) {
BAlert* alert = new BAlert("destAlert",
B_TRANSLATE("The destination folder does not exist."),
B_TRANSLATE("Cancel"), NULL, NULL,
B_TRANSLATE("Destination folder doesn't exist. "
"Would you like to create it?"),
B_TRANSLATE("Create"), B_TRANSLATE("Cancel"), NULL,
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return false;
} else if (!entry.IsDirectory()) {
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() != 0)
return false;
if (create_directory(fDestText->Text(), 0755) != B_OK) {
BAlert* alert = new BAlert("stopAlert",
B_TRANSLATE("Failed to create the destination folder."),
B_TRANSLATE("Cancel"), NULL, NULL,
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return false;
}
BEntry newEntry(fDestText->Text(), true);
newEntry.GetRef(&fDestRef);
return true;
}
if (!entry.IsDirectory()) {
BAlert* alert = new BAlert("destAlert",
B_TRANSLATE("The destination is not a folder."),
B_TRANSLATE("Cancel"), NULL, NULL,
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
alert->Go();
return false;
} else if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) {
}
if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) {
BAlert* alert = new BAlert("destAlert",
B_TRANSLATE("The destination is read only."),
B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
@@ -172,10 +193,10 @@ ExpanderWindow::ValidateDest()
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return false;
} else {
entry.GetRef(&fDestRef);
return true;
}
entry.GetRef(&fDestRef);
return true;
}
+1 -1
View File
@@ -216,7 +216,7 @@ SudokuField::Dump()
for (uint32 x = 0; x < fSize; x++) {
if (x != 0 && x % fBlockSize == 0)
putchar(' ');
printf("%lu", ValueAt(x, y));
printf("%" B_PRIu32, ValueAt(x, y));
}
putchar('\n');
}
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2007-2011, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2007-2012, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
@@ -161,7 +161,7 @@ SudokuGenerator::Generate(SudokuField* target, uint32 fieldsLeft,
if (removeCount <= 0 || *quit)
break;
}
printf(" remove count = %ld\n", removeCount);
printf(" remove count = %" B_PRId32 "\n", removeCount);
}
// set the remaining values to be initial values
+15 -15
View File
@@ -110,10 +110,10 @@ void
SudokuView::InitObject(const BMessage* archive)
{
fField = NULL;
fShowHintX = ~0UL;
fValueHintValue = ~0UL;
fLastHintValue = ~0UL;
fLastField = ~0UL;
fShowHintX = UINT32_MAX;
fValueHintValue = UINT32_MAX;
fLastHintValue = UINT32_MAX;
fLastField = UINT32_MAX;
fKeyboardX = 0;
fKeyboardY = 0;
fShowKeyboardFocus = false;
@@ -220,7 +220,7 @@ SudokuView::SetTo(entry_ref& ref)
_PushUndo();
status = fField->SetTo(_BaseCharacter(), buffer);
fValueHintValue = ~0UL;
fValueHintValue = UINT32_MAX;
Invalidate();
fclose(file);
return status;
@@ -243,7 +243,7 @@ SudokuView::SetTo(const char* data)
_PushUndo();
status = fField->SetTo(_BaseCharacter(), buffer);
fValueHintValue = ~0UL;
fValueHintValue = UINT32_MAX;
Invalidate();
return status;
}
@@ -260,7 +260,7 @@ SudokuView::SetTo(SudokuField* field)
fField = field;
fBlockSize = fField->BlockSize();
fValueHintValue = ~0UL;
fValueHintValue = UINT32_MAX;
FrameResized(0, 0);
Invalidate();
return B_OK;
@@ -757,12 +757,12 @@ SudokuView::_SetValueHintValue(uint32 value)
if (value == fValueHintValue)
return;
if (fValueHintValue != ~0UL)
if (fValueHintValue != UINT32_MAX)
_InvalidateValue(fValueHintValue, true);
fValueHintValue = value;
if (fValueHintValue != ~0UL)
if (fValueHintValue != UINT32_MAX)
_InvalidateValue(fValueHintValue, true);
}
@@ -770,13 +770,13 @@ SudokuView::_SetValueHintValue(uint32 value)
void
SudokuView::_RemoveHint()
{
if (fShowHintX == ~0UL)
if (fShowHintX == UINT32_MAX)
return;
uint32 x = fShowHintX;
uint32 y = fShowHintY;
fShowHintX = ~0;
fShowHintY = ~0;
fShowHintX = UINT32_MAX;
fShowHintY = UINT32_MAX;
_InvalidateField(x, y);
}
@@ -912,7 +912,7 @@ SudokuView::MouseDown(BPoint where)
fField->SetHintMaskAt(x, y, hintMask);
if (value + 1 != fValueHintValue) {
_SetValueHintValue(~0UL);
_SetValueHintValue(UINT32_MAX);
_InvalidateHintField(x, y, hintX, hintY);
} else
_InvalidateField(x, y);
@@ -1107,7 +1107,7 @@ SudokuView::MessageReceived(BMessage* message)
solver.SetTo(fField);
bigtime_t start = system_time();
solver.ComputeSolutions();
printf("found %ld solutions in %g msecs\n",
printf("found %" B_PRIu32 " solutions in %g msecs\n",
solver.CountSolutions(), (system_time() - start) / 1000.0);
if (solver.CountSolutions() > 0) {
_PushUndo();
@@ -1129,7 +1129,7 @@ SudokuView::MessageReceived(BMessage* message)
solver.SetTo(fField);
bigtime_t start = system_time();
solver.ComputeSolutions();
printf("found %ld solutions in %g msecs\n",
printf("found %" B_PRIu32 " solutions in %g msecs\n",
solver.CountSolutions(), (system_time() - start) / 1000.0);
if (solver.CountSolutions() > 0) {
_PushUndo();
+2 -1
View File
@@ -96,7 +96,8 @@ private:
void _InvalidateField(uint32 x, uint32 y);
void _InvalidateValue(uint32 value,
bool invalidateHint = false,
uint32 x = ~0UL, uint32 y = ~0UL);
uint32 x = UINT32_MAX,
uint32 y = UINT32_MAX);
void _InvalidateKeyboardFocus(uint32 x, uint32 y);
void _InsertKey(char rawKey, int32 modifiers);
void _SetValueHintValue(uint32 value);
+53 -48
View File
@@ -100,10 +100,10 @@ AppearancePrefView::AppearancePrefView(const char* name,
fFont = new BMenuField(B_TRANSLATE("Font:"), fontMenu);
fFontSize = new BMenuField(B_TRANSLATE("Size:"), sizeMenu);
BPopUpMenu* schemasPopUp = _MakeColorSchemaMenu(MSG_COLOR_SCHEMA_CHANGED,
gPredefinedSchemas, gPredefinedSchemas[0]);
fColorSchemaField = new BMenuField(B_TRANSLATE("Color schema:"),
schemasPopUp);
BPopUpMenu* schemesPopUp = _MakeColorSchemeMenu(MSG_COLOR_SCHEME_CHANGED,
gPredefinedColorSchemes, gPredefinedColorSchemes[0]);
fColorSchemeField = new BMenuField(B_TRANSLATE("Color scheme:"),
schemesPopUp);
BPopUpMenu* colorsPopUp = _MakeMenu(MSG_COLOR_FIELD_CHANGED, kColorTable,
kColorTable[0]);
@@ -139,8 +139,8 @@ AppearancePrefView::AppearancePrefView(const char* name,
.Add(fFont->CreateMenuBarLayoutItem(), 1, 2)
.Add(fFontSize->CreateLabelLayoutItem(), 0, 3)
.Add(fFontSize->CreateMenuBarLayoutItem(), 1, 3)
.Add(fColorSchemaField->CreateLabelLayoutItem(), 0, 4)
.Add(fColorSchemaField->CreateMenuBarLayoutItem(), 1, 4)
.Add(fColorSchemeField->CreateLabelLayoutItem(), 0, 4)
.Add(fColorSchemeField->CreateMenuBarLayoutItem(), 1, 4)
.Add(fColorField->CreateLabelLayoutItem(), 0, 5)
.Add(fColorField->CreateMenuBarLayoutItem(), 1, 5)
.End()
@@ -155,7 +155,7 @@ AppearancePrefView::AppearancePrefView(const char* name,
fFont->SetAlignment(B_ALIGN_RIGHT);
fFontSize->SetAlignment(B_ALIGN_RIGHT);
fColorField->SetAlignment(B_ALIGN_RIGHT);
fColorSchemaField->SetAlignment(B_ALIGN_RIGHT);
fColorSchemeField->SetAlignment(B_ALIGN_RIGHT);
fTabTitle->SetText(PrefHandler::Default()->getString(PREF_TAB_TITLE));
fWindowTitle->SetText(PrefHandler::Default()->getString(PREF_WINDOW_TITLE));
@@ -197,7 +197,7 @@ AppearancePrefView::Revert()
fWarnOnExit->SetValue(PrefHandler::Default()->getBool(
PREF_WARN_ON_EXIT));
fColorSchemaField->Menu()->ItemAt(0)->SetMarked(true);
fColorSchemeField->Menu()->ItemAt(0)->SetMarked(true);
fColorControl->SetValue(PrefHandler::Default()->
getRGB(PREF_TEXT_FORE_COLOR));
@@ -221,12 +221,12 @@ AppearancePrefView::AttachedToWindow()
fColorControl->SetTarget(this);
fColorField->Menu()->SetTargetForItems(this);
fColorSchemaField->Menu()->SetTargetForItems(this);
fColorSchemeField->Menu()->SetTargetForItems(this);
_SetCurrentColorSchema(fColorSchemaField);
_SetCurrentColorScheme(fColorSchemeField);
bool enableCustomColors =
!strcmp(fColorSchemaField->Menu()->FindMarked()->Label(),
gCustomSchema.name);
strcmp(fColorSchemeField->Menu()->FindMarked()->Label(),
gCustomColorScheme.name) == 0;
_EnableCustomColors(enableCustomColors);
}
@@ -250,18 +250,18 @@ AppearancePrefView::MessageReceived(BMessage* msg)
= pref->getString(PREF_HALF_FONT_FAMILY);
const char* currentStyle
= pref->getString(PREF_HALF_FONT_STYLE);
if (currentFamily == NULL || strcmp(currentFamily, family)
|| currentStyle == NULL || strcmp(currentStyle, style)) {
if (currentFamily == NULL || strcmp(currentFamily, family) != 0
|| currentStyle == NULL || strcmp(currentStyle, style) != 0) {
pref->setString(PREF_HALF_FONT_FAMILY, family);
pref->setString(PREF_HALF_FONT_STYLE, style);
modified = true;
}
break;
}
case MSG_HALF_SIZE_CHANGED:
if (strcmp(PrefHandler::Default()->getString(PREF_HALF_FONT_SIZE),
fFontSize->Menu()->FindMarked()->Label())) {
fFontSize->Menu()->FindMarked()->Label()) != 0) {
PrefHandler::Default()->setString(PREF_HALF_FONT_SIZE,
fFontSize->Menu()->FindMarked()->Label());
modified = true;
@@ -281,17 +281,17 @@ AppearancePrefView::MessageReceived(BMessage* msg)
}
break;
case MSG_COLOR_SCHEMA_CHANGED:
case MSG_COLOR_SCHEME_CHANGED:
{
color_schema* newSchema = NULL;
if (msg->FindPointer("color_schema",
(void**)&newSchema) == B_OK) {
color_scheme* newScheme = NULL;
if (msg->FindPointer("color_scheme",
(void**)&newScheme) == B_OK) {
if (newSchema == &gCustomSchema)
if (newScheme == &gCustomColorScheme)
_EnableCustomColors(true);
else
_EnableCustomColors(false);
_ChangeColorSchema(newSchema);
_ChangeColorScheme(newScheme);
modified = true;
}
break;
@@ -366,41 +366,46 @@ AppearancePrefView::_EnableCustomColors(bool enable)
void
AppearancePrefView::_ChangeColorSchema(color_schema* schema)
AppearancePrefView::_ChangeColorScheme(color_scheme* scheme)
{
PrefHandler* pref = PrefHandler::Default();
pref->setRGB(PREF_TEXT_FORE_COLOR, schema->text_fore_color);
pref->setRGB(PREF_TEXT_BACK_COLOR, schema->text_back_color);
pref->setRGB(PREF_SELECT_FORE_COLOR, schema->select_fore_color);
pref->setRGB(PREF_SELECT_BACK_COLOR, schema->select_back_color);
pref->setRGB(PREF_TEXT_FORE_COLOR, scheme->text_fore_color);
pref->setRGB(PREF_TEXT_BACK_COLOR, scheme->text_back_color);
pref->setRGB(PREF_SELECT_FORE_COLOR, scheme->select_fore_color);
pref->setRGB(PREF_SELECT_BACK_COLOR, scheme->select_back_color);
pref->setRGB(PREF_CURSOR_FORE_COLOR, scheme->cursor_fore_color);
pref->setRGB(PREF_CURSOR_BACK_COLOR, scheme->cursor_back_color);
}
void
AppearancePrefView::_SetCurrentColorSchema(BMenuField* field)
AppearancePrefView::_SetCurrentColorScheme(BMenuField* field)
{
PrefHandler* pref = PrefHandler::Default();
gCustomSchema.text_fore_color = pref->getRGB(PREF_TEXT_FORE_COLOR);
gCustomSchema.text_back_color = pref->getRGB(PREF_TEXT_BACK_COLOR);
gCustomSchema.select_fore_color = pref->getRGB(PREF_SELECT_FORE_COLOR);
gCustomSchema.select_back_color = pref->getRGB(PREF_SELECT_BACK_COLOR);
gCustomColorScheme.text_fore_color = pref->getRGB(PREF_TEXT_FORE_COLOR);
gCustomColorScheme.text_back_color = pref->getRGB(PREF_TEXT_BACK_COLOR);
gCustomColorScheme.select_fore_color = pref->getRGB(PREF_SELECT_FORE_COLOR);
gCustomColorScheme.select_back_color = pref->getRGB(PREF_SELECT_BACK_COLOR);
gCustomColorScheme.cursor_fore_color = pref->getRGB(PREF_CURSOR_FORE_COLOR);
gCustomColorScheme.cursor_back_color = pref->getRGB(PREF_CURSOR_BACK_COLOR);
const char* currentSchemaName = NULL;
const char* currentSchemeName = NULL;
color_schema** schemas = const_cast<color_schema**>(gPredefinedSchemas);
while (*schemas) {
if (gCustomSchema == **schemas) {
currentSchemaName = (*schemas)->name;
color_scheme** schemes
= const_cast<color_scheme**>(gPredefinedColorSchemes);
while (*schemes) {
if (gCustomColorScheme == **schemes) {
currentSchemeName = (*schemes)->name;
break;
}
schemas++;
schemes++;
}
for (int32 i = 0; i < fColorSchemaField->Menu()->CountItems(); i++) {
BMenuItem* item = fColorSchemaField->Menu()->ItemAt(i);
if (!strcmp(item->Label(), currentSchemaName)) {
for (int32 i = 0; i < fColorSchemeField->Menu()->CountItems(); i++) {
BMenuItem* item = fColorSchemeField->Menu()->ItemAt(i);
if (strcmp(item->Label(), currentSchemeName) == 0) {
item->SetMarked(true);
break;
}
@@ -435,8 +440,8 @@ AppearancePrefView::_MakeFontMenu(uint32 command,
BMenuItem* item = new BMenuItem(itemLabel,
message);
menu->AddItem(item);
if (!strcmp(defaultFamily, family)
&& !strcmp(defaultStyle, style))
if (strcmp(defaultFamily, family) == 0
&& strcmp(defaultStyle, style) == 0)
item->SetMarked(true);
}
}
@@ -497,7 +502,7 @@ AppearancePrefView::_MakeMenu(uint32 msg, const char** items,
int32 i = 0;
while (*items) {
if (!strcmp((*items), ""))
if (strcmp((*items), "") == 0)
menu->AddSeparatorItem();
else {
BMessage* message = new BMessage(msg);
@@ -517,18 +522,18 @@ AppearancePrefView::_MakeMenu(uint32 msg, const char** items,
/*static*/ BPopUpMenu*
AppearancePrefView::_MakeColorSchemaMenu(uint32 msg, const color_schema** items,
const color_schema* defaultItemName)
AppearancePrefView::_MakeColorSchemeMenu(uint32 msg, const color_scheme** items,
const color_scheme* defaultItemName)
{
BPopUpMenu* menu = new BPopUpMenu("");
int32 i = 0;
while (*items) {
if (!strcmp((*items)->name, ""))
if (strcmp((*items)->name, "") == 0)
menu->AddSeparatorItem();
else {
BMessage* message = new BMessage(msg);
message->AddPointer("color_schema", (const void*)*items);
message->AddPointer("color_scheme", (const void*)*items);
menu->AddItem(new BMenuItem((*items)->name, message));
}
+8 -8
View File
@@ -19,7 +19,7 @@ static const uint32 MSG_FULL_FONT_CHANGED = 'mcff';
static const uint32 MSG_FULL_SIZE_CHANGED = 'mcfs';
static const uint32 MSG_COLOR_FIELD_CHANGED = 'mccf';
static const uint32 MSG_COLOR_CHANGED = 'mcbc';
static const uint32 MSG_COLOR_SCHEMA_CHANGED = 'mccs';
static const uint32 MSG_COLOR_SCHEME_CHANGED = 'mccs';
static const uint32 MSG_TAB_TITLE_SETTING_CHANGED = 'mtts';
static const uint32 MSG_WINDOW_TITLE_SETTING_CHANGED = 'mwts';
@@ -32,7 +32,7 @@ static const uint32 MSG_HISTORY_CHANGED = 'mhst';
static const uint32 MSG_PREF_MODIFIED = 'mpmo';
struct color_schema;
struct color_scheme;
class BCheckBox;
class BColorControl;
class BMenu;
@@ -56,8 +56,8 @@ public:
private:
void _EnableCustomColors(bool enable);
void _ChangeColorSchema(color_schema* schema);
void _SetCurrentColorSchema(BMenuField* field);
void _ChangeColorScheme(color_scheme* scheme);
void _SetCurrentColorScheme(BMenuField* field);
static BMenu* _MakeFontMenu(uint32 command,
const char* defaultFamily,
@@ -68,16 +68,16 @@ private:
static BPopUpMenu* _MakeMenu(uint32 msg, const char** items,
const char* defaultItem);
static BPopUpMenu* _MakeColorSchemaMenu(uint32 msg,
const color_schema** schemas,
const color_schema* defaultItemName);
static BPopUpMenu* _MakeColorSchemeMenu(uint32 msg,
const color_scheme** schemes,
const color_scheme* defaultItemName);
BCheckBox* fBlinkCursor;
BCheckBox* fWarnOnExit;
BMenuField* fFont;
BMenuField* fFontSize;
BMenuField* fColorSchemaField;
BMenuField* fColorSchemeField;
BMenuField* fColorField;
BColorControl* fColorControl;
+58 -22
View File
@@ -1,23 +1,27 @@
/*
* Copyright 2010, Haiku, Inc.
* Copyright 2010-2012, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#include "Colors.h"
#include <Catalog.h>
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "Terminal colors schema"
#define B_TRANSLATION_CONTEXT "Terminal colors scheme"
// Standard colors
const rgb_color kBlack= { 0, 0, 0, 255 };
const rgb_color kWhite = { 255, 255, 255, 255 };
const rgb_color kGreen = { 0, 255, 0, 255 };
const rgb_color kWhite = { 255, 255, 255, 255 };
const rgb_color kYellow = { 255, 255, 0, 255 };
const struct color_schema kBlackOnWhite = {
B_TRANSLATE("Black on White"),
const struct color_scheme kColorSchemeDefault = {
B_TRANSLATE("Default"),
kBlack,
kWhite,
kWhite,
@@ -26,9 +30,18 @@ const struct color_schema kBlackOnWhite = {
kBlack
};
const struct color_scheme kColorSchemeBlue = {
B_TRANSLATE("Blue"),
kYellow,
{ 0, 0, 139, 255 },
kBlack,
kWhite,
kBlack,
{ 0, 139, 139, 255 },
};
const struct color_schema kWhiteOnBlack = {
B_TRANSLATE("White on Black"),
const struct color_scheme kColorSchemeMidnight = {
B_TRANSLATE("Midnight"),
kWhite,
kBlack,
kBlack,
@@ -37,8 +50,18 @@ const struct color_schema kWhiteOnBlack = {
kWhite
};
const struct color_schema kGreenOnBlack = {
B_TRANSLATE("Green on Black"),
const struct color_scheme kColorSchemeProfessional = {
B_TRANSLATE("Professional"),
kWhite,
{ 8, 8, 8, 255 },
{ 50, 50, 50, 255 },
kWhite,
kWhite,
{ 50, 50, 50, 255 },
};
const struct color_scheme kColorSchemeRetro = {
B_TRANSLATE("Retro"),
kGreen,
kBlack,
kBlack,
@@ -47,28 +70,41 @@ const struct color_schema kGreenOnBlack = {
kGreen
};
struct color_schema gCustomSchema = {
const struct color_scheme kColorSchemeSlate = {
B_TRANSLATE("Slate"),
kWhite,
{ 20, 20, 28, 255 },
{ 70, 70, 70, 255 },
{ 255, 200, 0, 255 },
kWhite,
{ 70, 70, 70, 255 },
};
struct color_scheme gCustomColorScheme = {
B_TRANSLATE("Custom")
};
const color_schema* gPredefinedSchemas[] = {
&kBlackOnWhite,
&kWhiteOnBlack,
&kGreenOnBlack,
&gCustomSchema,
const color_scheme* gPredefinedColorSchemes[] = {
&kColorSchemeDefault,
&kColorSchemeBlue,
&kColorSchemeMidnight,
&kColorSchemeProfessional,
&kColorSchemeRetro,
&kColorSchemeSlate,
&gCustomColorScheme,
NULL
};
bool
color_schema::operator==(const color_schema& schema)
color_scheme::operator==(const color_scheme& scheme)
{
if (text_fore_color == schema.text_fore_color
&& text_back_color == schema.text_back_color
&& cursor_fore_color == schema.cursor_fore_color
&& cursor_back_color == schema.cursor_back_color
&& select_fore_color == schema.select_fore_color
&& select_back_color == schema.select_back_color)
if (text_fore_color == scheme.text_fore_color
&& text_back_color == scheme.text_back_color
&& cursor_fore_color == scheme.cursor_fore_color
&& cursor_back_color == scheme.cursor_back_color
&& select_fore_color == scheme.select_fore_color
&& select_back_color == scheme.select_back_color)
return true;
return false;
+7 -6
View File
@@ -1,13 +1,15 @@
/*
* Copyright 2010, Haiku, Inc.
* Copyright 2010-2012, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _COLORS_H
#define _COLORS_H
#include <InterfaceDefs.h>
struct color_schema {
struct color_scheme {
const char* name;
rgb_color text_fore_color;
rgb_color text_back_color;
@@ -15,12 +17,11 @@ struct color_schema {
rgb_color cursor_back_color;
rgb_color select_fore_color;
rgb_color select_back_color;
bool operator==(const color_schema& color);
bool operator==(const color_scheme& color);
};
extern color_schema gCustomSchema;
extern const color_schema* gPredefinedSchemas[];
extern color_scheme gCustomColorScheme;
extern const color_scheme* gPredefinedColorSchemes[];
#endif // _COLORS_H
+3 -3
View File
@@ -45,7 +45,7 @@ static const pref_defaults kTermDefaults[] = {
{ PREF_TEXT_FORE_COLOR, " 0, 0, 0" },
{ PREF_TEXT_BACK_COLOR, "255, 255, 255" },
{ PREF_CURSOR_FORE_COLOR, " 0, 0, 0" },
{ PREF_CURSOR_BACK_COLOR, "255, 200, 0" },
{ PREF_CURSOR_BACK_COLOR, " 0, 0, 0" },
{ PREF_SELECT_FORE_COLOR, "255, 255, 255" },
{ PREF_SELECT_BACK_COLOR, " 0, 0, 0" },
@@ -242,7 +242,7 @@ PrefHandler::getBool(const char *key)
if (value == NULL)
return false;
return !strcmp(value, PREF_TRUE);
return strcmp(value, PREF_TRUE) == 0;
}
@@ -352,7 +352,7 @@ PrefHandler::_ConfirmFont(const char *key, const BFont *fallback)
if (get_font_family(i, &family) != B_OK)
continue;
if (!strcmp(family, font)) {
if (strcmp(family, font) == 0) {
// found font family: we can safely use this font
return;
}
+2 -2
View File
@@ -200,7 +200,7 @@ TermApp::RefsReceived(BMessage* message)
info.GetType(mimetype);
// if App opened by Pref file
if (!strcmp(mimetype, PREFFILE_MIMETYPE)) {
if (strcmp(mimetype, PREFFILE_MIMETYPE) == 0) {
BEntry ent(&ref);
BPath path(&ent);
@@ -209,7 +209,7 @@ TermApp::RefsReceived(BMessage* message)
}
// if App opened by Shell Script
if (!strcmp(mimetype, "text/x-haiku-shscript")){
if (strcmp(mimetype, "text/x-haiku-shscript") == 0) {
// Not implemented.
// beep();
return;
+6 -3
View File
@@ -1862,7 +1862,8 @@ TermView::MessageReceived(BMessage *msg)
int32 encodingID;
BMessage specifier;
if (msg->GetCurrentSpecifier(&i, &specifier) == B_OK
&& !strcmp("encoding", specifier.FindString("property", i))) {
&& !strcmp("encoding",
specifier.FindString("property", i)) == 0) {
msg->FindInt32 ("data", &encodingID);
SetEncoding(encodingID);
msg->SendReply(B_REPLY);
@@ -1877,11 +1878,13 @@ TermView::MessageReceived(BMessage *msg)
int32 i;
BMessage specifier;
if (msg->GetCurrentSpecifier(&i, &specifier) == B_OK
&& !strcmp("encoding", specifier.FindString("property", i))) {
&& strcmp("encoding",
specifier.FindString("property", i)) == 0) {
BMessage reply(B_REPLY);
reply.AddInt32("result", Encoding());
msg->SendReply(&reply);
} else if (!strcmp("tty", specifier.FindString("property", i))) {
} else if (strcmp("tty",
specifier.FindString("property", i)) == 0) {
BMessage reply(B_REPLY);
reply.AddString("result", TerminalName());
msg->SendReply(&reply);
+1 -1
View File
@@ -839,7 +839,7 @@ TermWindow::MessageReceived(BMessage *message)
break;
case MSG_COLOR_CHANGED:
case MSG_COLOR_SCHEMA_CHANGED:
case MSG_COLOR_SCHEME_CHANGED:
{
_SetTermColors(_ActiveTermViewContainerView());
_ActiveTermViewContainerView()->Invalidate();
+27 -24
View File
@@ -95,6 +95,7 @@ Cache<block_run>::Cacheable *BlockRunCache::NewCacheable(block_run run)
Disk::Disk(const char *deviceName, bool rawMode, off_t start, off_t stop)
:
fBufferedFile(NULL),
fRawDiskOffset(0),
fSize(0LL),
fCache(this),
@@ -121,6 +122,7 @@ Disk::Disk(const char *deviceName, bool rawMode, off_t start, off_t stop)
//fprintf(stderr,"Could not open file: %s\n",strerror(fFile.InitCheck()));
return;
}
fBufferedFile = new BBufferIO(&fFile, 1024 * 1024, false);
int device = open(deviceName, O_RDONLY);
if (device < B_OK) {
@@ -153,7 +155,7 @@ Disk::Disk(const char *deviceName, bool rawMode, off_t start, off_t stop)
return;
}
if (fFile.ReadAt(512 + fRawDiskOffset, &fSuperBlock,
if (fBufferedFile->ReadAt(512 + fRawDiskOffset, &fSuperBlock,
sizeof(disk_super_block)) < 1)
fprintf(stderr,"Disk: Could not read super block\n");
@@ -163,6 +165,7 @@ Disk::Disk(const char *deviceName, bool rawMode, off_t start, off_t stop)
Disk::~Disk()
{
delete fBufferedFile;
}
@@ -171,7 +174,7 @@ status_t Disk::InitCheck()
status_t status = fFile.InitCheck();
if (status == B_OK)
return fSize == 0LL ? B_ERROR : B_OK;
return status;
}
@@ -201,7 +204,7 @@ uint8 *Disk::ReadBlockRun(block_run run)
CacheableBlockRun *entry = (CacheableBlockRun *)fCache.Get(run);
if (entry)
return entry->Data();
return NULL;
}
@@ -234,7 +237,7 @@ Disk::DumpBootBlockToFile()
// #pragma mark - Superblock recovery methods
status_t
status_t
Disk::ScanForSuperBlock(off_t start, off_t stop)
{
printf("Disk size %Ld bytes, %.2f GB\n", fSize, 1.0 * fSize / (1024*1024*1024));
@@ -256,7 +259,7 @@ Disk::ScanForSuperBlock(off_t start, off_t stop)
if (((offset-start) % (blockSize * 100)) == 0)
printf(" %12Ld, %.2f GB %s1A\n",offset,1.0 * offset / (1024*1024*1024),escape);
ssize_t bytes = fFile.ReadAt(offset, buffer, blockSize + 1024);
ssize_t bytes = fBufferedFile->ReadAt(offset, buffer, blockSize + 1024);
if (bytes < B_OK)
{
fprintf(stderr,"Could not read from device: %s\n", strerror(bytes));
@@ -322,7 +325,7 @@ Disk::ScanForSuperBlock(off_t start, off_t stop)
// ToDo: free the other disk infos
fRawDiskOffset = info->offset;
fFile.Seek(fRawDiskOffset, SEEK_SET);
fBufferedFile->Seek(fRawDiskOffset, SEEK_SET);
if (ValidateSuperBlock(info->super_block))
fSize = info->super_block.block_size * info->super_block.block_size;
@@ -382,7 +385,7 @@ Disk::RecreateSuperBlock()
printf("\tblock size = %ld\n",BlockSize());
strcpy(fSuperBlock.name,"recovered");
strcpy(fSuperBlock.name,"recovered");
fSuperBlock.magic1 = SUPER_BLOCK_MAGIC1;
fSuperBlock.fs_byte_order = SUPER_BLOCK_FS_LENDIAN;
fSuperBlock.block_shift = get_shift(BlockSize());
@@ -422,7 +425,7 @@ Disk::RecreateSuperBlock()
GetNextSpecialInode(buffer,&offset,offset + 32LL * 65536 * BlockSize(),true);
if (fValidOffset == 0LL)
{
{
fprintf(stderr,"FATAL ERROR: Could not find valid inode!\n");
return B_ERROR;
}
@@ -439,7 +442,7 @@ Disk::RecreateSuperBlock()
fSuperBlock.num_ags = divide_roundup(fSuperBlock.num_blocks,allocationGroupSize);
// calculate rest of log area
fSuperBlock.log_blocks.allocation_group = fLogStart / allocationGroupSize;
fSuperBlock.log_blocks.start = fLogStart - fSuperBlock.log_blocks.allocation_group * allocationGroupSize;
fSuperBlock.log_blocks.length = LogSize(); // assumed length of 2048 blocks
@@ -488,7 +491,7 @@ Disk::DetermineBlockSize()
// read a quarter of the drive at maximum
for (; offset < (fSize >> 2); offset += 1024) {
if (fFile.ReadAt(offset, buffer, sizeof(buffer)) < B_OK) {
if (fBufferedFile->ReadAt(offset, buffer, sizeof(buffer)) < B_OK) {
fprintf(stderr, "could not read from device (offset = %Ld, "
"size = %ld)!\n", offset, sizeof(buffer));
status = B_IO_ERROR;
@@ -547,7 +550,7 @@ Disk::GetNextSpecialInode(char *buffer, off_t *_offset, off_t end,
bfs_inode *inode = (bfs_inode *)buffer;
for (; offset < end; offset += BlockSize()) {
if (fFile.ReadAt(offset, buffer, 1024) < B_OK) {
if (fBufferedFile->ReadAt(offset, buffer, 1024) < B_OK) {
fprintf(stderr,"could not read from device (offset = %Ld, size = %d)!\n",offset,1024);
*_offset = offset;
return B_IO_ERROR;
@@ -565,7 +568,7 @@ Disk::GetNextSpecialInode(char *buffer, off_t *_offset, off_t end,
&& offset >= (BlockSize() * (fLogStart + LogSize()))) {
fValidBlockRun = inode->inode_num;
fValidOffset = offset;
if (skipAfterValidInode)
return B_OK;
}
@@ -653,31 +656,31 @@ Disk::ScanForIndexAndRoot(bfs_inode *indexDir,bfs_inode *rootDir)
if (!root) {
printf("WARNING: Could not find root node at common places!\n");
printf("\tScanning log area for root node\n");
off_t logOffset = ToOffset(fSuperBlock.log_blocks);
if (GetNextSpecialInode(buffer,&logOffset,logOffset + LogSize() * BlockSize()) == B_OK)
{
SaveInode(inode,&indices,indexDir,&root,rootDir);
printf("root node at: 0x%Lx (DiskProbe)\n",logOffset / 512);
//fFile.ReadAt(logOffset + BlockSize(),buffer,1024);
//fBufferedFile->ReadAt(logOffset + BlockSize(),buffer,1024);
//if (*(uint32 *)buffer == BPLUSTREE_MAGIC)
//{
// puts("\t\tnext block in log contains a bplustree!");
//}
}
}
/*if (!root)
{
char txt[64];
printf("Should I perform a deeper search (that will take some time) (Y/N) [N]? ");
gets(txt);
if (!strcasecmp("y",txt))
{
// search not so common places for the root node (all places)
if (indices)
offset += BlockSize(); // the block after the indices inode
else
@@ -700,28 +703,28 @@ Disk::ScanForIndexAndRoot(bfs_inode *indexDir,bfs_inode *rootDir)
ssize_t
Disk::Read(void *buffer, size_t size)
{
return fFile.Read(buffer, size);
return fBufferedFile->Read(buffer, size);
}
ssize_t
Disk::Write(const void *buffer, size_t size)
{
return fFile.Write(buffer, size);
return fBufferedFile->Write(buffer, size);
}
ssize_t
Disk::ReadAt(off_t pos, void *buffer, size_t size)
{
return fFile.ReadAt(pos + fRawDiskOffset, buffer, size);
return fBufferedFile->ReadAt(pos + fRawDiskOffset, buffer, size);
}
ssize_t
Disk::WriteAt(off_t pos, const void *buffer, size_t size)
{
return fFile.WriteAt(pos + fRawDiskOffset, buffer, size);
return fBufferedFile->WriteAt(pos + fRawDiskOffset, buffer, size);
}
@@ -731,14 +734,14 @@ Disk::Seek(off_t position, uint32 seekMode)
// ToDo: only correct for seekMode == SEEK_SET, right??
if (seekMode != SEEK_SET)
puts("OH NO, I AM BROKEN!");
return fFile.Seek(position + fRawDiskOffset, seekMode);
return fBufferedFile->Seek(position + fRawDiskOffset, seekMode);
}
off_t
Disk::Position() const
{
return fFile.Position() - fRawDiskOffset;
return fBufferedFile->Position() - fRawDiskOffset;
}
+6 -3
View File
@@ -6,6 +6,7 @@
*/
#include <BufferIO.h>
#include <File.h>
#include <Path.h>
@@ -23,9 +24,9 @@ class BlockRunCache : public Cache<block_run>
public:
BlockRunCache(Disk *disk);
// ~BlockRunCache();
virtual Cacheable *NewCacheable(block_run run);
protected:
Disk *fDisk;
};
@@ -91,7 +92,9 @@ class Disk : public BPositionIO
status_t LoadBootBlock();
protected:
BFile fFile;
BBufferIO* fBufferedFile;
BPath fPath;
off_t fRawDiskOffset;
off_t fSize;
@@ -101,7 +104,7 @@ class Disk : public BPositionIO
block_run fValidBlockRun;
off_t fValidOffset;
off_t fLogStart;
BlockRunCache fCache;
bool fRawMode;
+16 -9
View File
@@ -40,11 +40,11 @@ Hashtable::Hashtable(int capacity, float loadFactor)
if (!capacity)
capacity = 1;
if (!(fTable = (struct Entry **)malloc(capacity * sizeof(void *))))
return;
memset(fTable,0,capacity * sizeof(void *));
fThreshold = (int)(capacity * loadFactor);
fModCount = 0;
fLoadFactor = loadFactor;
@@ -58,7 +58,7 @@ Hashtable::Hashtable(int capacity, float loadFactor)
Hashtable::~Hashtable()
{
struct Entry **table = fTable;
for(int32 index = fCapacity;--index >= 0;)
{
struct Entry *entry,*next;
@@ -136,7 +136,7 @@ void *Hashtable::Remove(const void *key)
table = fTable;
hash = (func = fHashFunc)(key);
index = hash % fCapacity;
for(entry = table[index],prev = NULL;entry;entry = entry->next)
{
if ((func(entry->key) == hash) && fCompareFunc(entry->key,key))
@@ -148,7 +148,7 @@ void *Hashtable::Remove(const void *key)
prev->next = entry->next;
else
table[index] = entry->next;
fCount--;
value = entry->value;
delete entry;
@@ -180,7 +180,7 @@ status_t Hashtable::GetNextEntry(void **value)
*value = fIteratorEntry->value;
return B_OK;
}
return B_ENTRY_NOT_FOUND;
}
@@ -227,10 +227,17 @@ Hashtable::MakeEmpty(int8 keyMode,int8 valueMode)
}
size_t
Hashtable::Size() const
{
return fCount;
}
/** The hash table will be doubled in size, and rebuild.
* @return true on success
*/
bool Hashtable::Rehash()
{
uint32 (*hashCode)(const void *) = fHashFunc;
@@ -270,10 +277,10 @@ Hashtable::Entry *Hashtable::GetHashEntry(const void *key)
{
Entry **table,*entry;
uint32 hash,(*func)(const void *);
table = fTable;
hash = (func = fHashFunc)(key);
for(entry = table[hash % fCapacity];entry;entry = entry->next)
{
if ((func(entry->key) == hash) && fCompareFunc(entry->key,key))
+2 -1
View File
@@ -33,7 +33,8 @@ class Hashtable
void Rewind();
void MakeEmpty(int8 keyMode = HASH_EMPTY_NONE,int8 valueMode = HASH_EMPTY_NONE);
size_t Size() const;
protected:
class Entry
{
+4 -4
View File
@@ -91,7 +91,7 @@ Inode::_Unset()
free(fPath);
fPath = NULL;
delete fAttributes;
delete fAttributes;
fAttributes = NULL;
}
@@ -522,7 +522,7 @@ Inode::CopyAttributesTo(BNode *node)
strerror(written));
} else if ((size_t)written < size) {
printf("could only write %ld bytes (from %ld) at attribute \"%s\"\n",
written, size, name);
written, size, name);
}
}
@@ -1075,7 +1075,7 @@ Directory::CopyTo(const char *root, bool fullPath, Inode::Source *source)
BPath path(root);
if (fullPath && Path(source))
path.Append(Path(source));
char *name = (char *)Name();
if (name != NULL) {
// changes the filename in the inode buffer (for deleted entries)
@@ -1094,7 +1094,7 @@ Directory::CopyTo(const char *root, bool fullPath, Inode::Source *source)
BDirectory directory;
if ((status = entry.GetParent(&directory)) < B_OK)
return status;
status = directory.CreateDirectory(path.Leaf(), NULL);
if (status < B_OK && status != B_FILE_EXISTS)
return status;
+2 -2
View File
@@ -114,7 +114,7 @@ class DataStream : public Inode, public BPositionIO {
virtual off_t Position() const;
virtual status_t SetSize(off_t size);
private:
int32 fCurrent;
int32 fLevel;
@@ -156,7 +156,7 @@ class Directory : public DataStream {
Directory(Disk *disk, bfs_inode *inode, bool ownBuffer = true);
Directory(const Inode &inode);
~Directory();
virtual status_t InitCheck();
virtual status_t CopyTo(const char *path, bool fullPath = true,
Inode::Source *source = NULL);
+118 -79
View File
@@ -5,6 +5,8 @@
//! recovers corrupt BFS disks
#include <set>
#include "Disk.h"
#include "Inode.h"
#include "Hashtable.h"
@@ -30,6 +32,10 @@ bool gRawMode = false;
bool gVerbose = false;
// TODO: add a cache for all inodes
typedef std::set<block_run> RunSet;
class InodeHashtable {
public:
InodeHashtable(int capacity)
@@ -113,7 +119,7 @@ class InodeHashtable {
static uint32 BlockRunHash(const block_run *run)
{
return run->allocation_group << 16 | run->start;
return (run->allocation_group << 16) | run->start;
}
static bool BlockRunCompare(const block_run *runA, const block_run *runB)
@@ -127,11 +133,14 @@ class InodeHashtable {
uint32 fPercentUsed;
};
class InodeGetter {
public:
InodeGetter(InodeHashtable& hashtable, block_run run)
InodeGetter(Disk& disk, block_run run)
{
fInode = hashtable.Get(run);
fInode = Inode::Factory(&disk, run);
if (fInode != NULL)
fInode->AcquireBuffer();
}
~InodeGetter()
@@ -140,14 +149,22 @@ class InodeGetter {
fInode->ReleaseBuffer();
}
Inode* Node() { return fInode; }
Inode* Node() const
{
return fInode;
}
void Detach()
{
fInode = NULL;
}
private:
Inode* fInode;
};
InodeHashtable gHashtable(1000);
RunSet gMainInodes;
// contains all inodes found on disk in the general data area
InodeHashtable gLogged(50);
// contains all inodes found in the log area
@@ -156,32 +173,56 @@ InodeHashtable gMissingEmpty(25);
class HashtableInodeSource : public Inode::Source {
public:
virtual Inode *InodeAt(block_run run)
{
Inode *inode;
if ((inode = gHashtable.Get(run)) != NULL)
return inode;
public:
HashtableInodeSource(Disk& disk)
:
fDisk(disk)
{
}
if ((inode = gLogged.Get(run)) != NULL)
return inode;
virtual Inode *InodeAt(block_run run)
{
Inode *inode;
if ((inode = gLogged.Get(run)) != NULL)
return inode;
if ((inode = gMissing.Get(run)) != NULL)
return inode;
if ((inode = gMissing.Get(run)) != NULL)
return inode;
if (gMainInodes.find(run) == gMainInodes.end())
return NULL;
}
return Inode::Factory(&fDisk, run);
}
private:
Disk& fDisk;
};
bool
operator<(const block_run& a, const block_run& b)
{
return a.allocation_group < b.allocation_group
|| (a.allocation_group == b.allocation_group && a.start < b.start);
}
void
collectInodes(Disk &disk, InodeHashtable &hashtable, off_t start, off_t end)
collectInodes(Disk& disk, RunSet* set, InodeHashtable* hashTable, off_t start,
off_t end)
{
char buffer[8192];
Inode inode(&disk, (bfs_inode *)buffer, false);
off_t count = 0LL;
off_t position = start;
off_t directories = 0LL;
off_t directorySize = 0LL;
off_t files = 0LL;
off_t fileSize = 0LL;
off_t symlinks = 0LL;
off_t count = 0LL;
off_t position = start;
bigtime_t lastUpdate = system_time();
for (off_t offset = start; offset < end; offset += sizeof(buffer)) {
@@ -203,7 +244,21 @@ collectInodes(Disk &disk, InodeHashtable &hashtable, off_t start, off_t end)
if (node != NULL) {
if (gVerbose)
printf(" node: %Ld \"%s\"\n", position, node->Name());
hashtable.Insert(node);
if (set != NULL)
set->insert(node->BlockRun());
else
hashTable->Insert(node);
if (node->IsDirectory()) {
directories++;
directorySize += node->Size();
} else if (node->IsFile()) {
files++;
fileSize += node->Size();
} else if (node->IsSymlink()) {
symlinks++;
}
count++;
} else if (gVerbose) {
printf("\nunrecognized inode:");
@@ -213,40 +268,18 @@ collectInodes(Disk &disk, InodeHashtable &hashtable, off_t start, off_t end)
position += disk.BlockSize();
}
if (system_time() - lastUpdate > 500000) {
printf(" block %Ld (%Ld%%), %Ld inodes\33[1A\n", offset, 100 * (offset - start) / (end - start), count);
printf(" block %Ld (%Ld%%), %Ld inodes\33[1A\n", offset,
100 * (offset - start) / (end - start), count);
lastUpdate = system_time();
}
}
printf("\n%Ld inodes found.\n", count);
Inode *node;
off_t directories = 0LL;
off_t directorySize = 0LL;
off_t files = 0LL;
off_t fileSize = 0LL;
off_t symlinks = 0LL;
count = 0LL;
hashtable.Rewind();
while (hashtable.GetNextEntry(&node) == B_OK) {
if (node->IsDirectory()) {
directories++;
directorySize += node->Size();
} else if (node->IsFile()) {
files++;
fileSize += node->Size();
} else if (node->IsSymlink()) {
symlinks++;
}
count++;
hashtable.Release(node);
}
printf("\n%20Ld directories found (total of %Ld bytes)\n"
"%20Ld files found (total of %Ld bytes)\n"
"%20Ld symlinks found\n"
"--------------------\n"
"%20Ld inodes total found in hashtable.\n",
"%20Ld inodes total found.\n",
directories, directorySize, files, fileSize, symlinks, count);
}
@@ -259,8 +292,8 @@ collectLogInodes(Disk &disk)
off_t end = offset + (disk.Log().length << disk.BlockShift());
printf("\nsearching from %Ld to %Ld (log area)\n",offset,end);
collectInodes(disk, gLogged, offset, end);
collectInodes(disk, NULL, &gLogged, offset, end);
}
@@ -270,39 +303,41 @@ collectRealInodes(Disk &disk)
// first block after bootblock, bitmap, and log
off_t offset = disk.ToOffset(disk.Log()) + (disk.Log().length
<< disk.BlockShift());
off_t end = /*(17LL << disk.SuperBlock()->ag_shift);
if (end > disk.NumBlocks())
end = */disk.NumBlocks();
end *= disk.BlockSize();
off_t end = (off_t)disk.NumBlocks() << disk.BlockShift();
printf("\nsearching from %Ld to %Ld (main area)\n", offset, end);
collectInodes(disk, gHashtable, offset, end);
collectInodes(disk, &gMainInodes, NULL, offset, end);
}
Directory *
getNameIndex(Disk &disk)
{
InodeGetter getter(gHashtable, disk.Indices());
InodeGetter getter(disk, disk.Indices());
Directory *indices = dynamic_cast<Directory *>(getter.Node());
block_run run;
if (indices && indices->FindEntry("name", &run) == B_OK)
return dynamic_cast<Directory *>(gHashtable.Get(run));
if (indices != NULL && indices->FindEntry("name", &run) == B_OK) {
InodeGetter getter(disk, run);
Inode* node = getter.Node();
getter.Detach();
return dynamic_cast<Directory *>(node);
}
// search name index
Inode *node;
RunSet::iterator iterator = gMainInodes.begin();
for (; iterator != gMainInodes.end(); iterator++) {
InodeGetter getter(disk, *iterator);
Inode* node = getter.Node();
gHashtable.Rewind();
for (; gHashtable.GetNextEntry(&node) == B_OK; gHashtable.Release(node)) {
if (!node->IsIndex() || node->Name() == NULL)
continue;
if (!strcmp(node->Name(), "name") && node->Mode() & S_STR_INDEX) {
if (!strcmp(node->Name(), "name") && node->Mode() & S_STR_INDEX)
return dynamic_cast<Directory *>(node);
}
}
return NULL;
}
@@ -317,7 +352,7 @@ checkDirectoryContents(Disk& disk, Directory *dir)
while (dir->GetNextEntry(name, &run) == B_OK) {
if (run == dir->BlockRun() || run == dir->Parent()
|| gHashtable.Contains(&run))
|| gMainInodes.find(run) != gMainInodes.end())
continue;
Inode *missing = gMissing.Get(run);
@@ -385,8 +420,12 @@ checkStructure(Disk &disk)
Inode *node;
off_t count = 0;
gHashtable.Rewind();
while (gHashtable.GetNextEntry(&node) == B_OK) {
RunSet::iterator iterator = gMainInodes.begin();
for (; iterator != gMainInodes.end(); iterator++) {
InodeGetter getter(disk, *iterator);
Inode* node = getter.Node();
count++;
if ((count % 50) == 0)
fprintf(stderr, "%Ld inodes processed...\33[1A\n", count);
@@ -399,7 +438,7 @@ checkStructure(Disk &disk)
// check for the parent directory
block_run run = node->Parent();
InodeGetter parentGetter(gHashtable, run);
InodeGetter parentGetter(disk, run);
Inode *parentNode = parentGetter.Node();
Directory *dir = dynamic_cast<Directory *>(parentNode);
@@ -503,13 +542,13 @@ checkStructure(Disk &disk)
// printf("node \"%s\": parent directory \"%s\" error: %s\n",node->Name(),dir->Name(),strerror(status));
// }
// check for attributes
// check for attributes
run = node->Attributes();
if (!run.IsZero()) {
//printf("node \"%s\" (%ld, %d, mode = %010lo): has attribute dir!\n",node->Name(),node->BlockRun().allocation_group,node->BlockRun().start,node->Mode());
if (!gHashtable.Contains(&run)) {
if (gMainInodes.find(run) == gMainInodes.end()) {
if (gVerbose) {
printf("node \"%s\": attributes are missing (%ld, %d, %d)\n",
node->Name(), run.allocation_group, run.start, run.length);
@@ -602,7 +641,7 @@ checkStructure(Disk &disk)
block_run run;
while (dir->GetNextEntry(name, &run) == B_OK) {
printf("\t\"%s\" (%ld, %d, %d)\n", name,
run.allocation_group, run.start, run.length);
run.allocation_group, run.start, run.length);
}
BPlusTree *tree;
@@ -631,33 +670,34 @@ checkStructure(Disk &disk)
void
copyInodes(const char *copyTo)
copyInodes(Disk& disk, const char* copyTo)
{
if (!copyTo)
if (copyTo == NULL)
return;
Inode::Source *source = new HashtableInodeSource;
HashtableInodeSource source(disk);
Inode *node;
int32 count = 0;
gHashtable.Rewind();
while (gHashtable.GetNextEntry(&node) == B_OK) {
RunSet::iterator iterator = gMainInodes.begin();
for (; iterator != gMainInodes.end(); iterator++) {
InodeGetter getter(disk, *iterator);
Inode* node = getter.Node();
if (!node->IsIndex() && !node->IsAttributeDirectory())
node->CopyTo(copyTo, source);
node->CopyTo(copyTo, &source);
if ((++count % 500) == 0)
fprintf(stderr, "copied %ld files...\n", count);
gHashtable.Release(node);
}
gMissing.Rewind();
while (gMissing.GetNextEntry(&node) == B_OK) {
if (!node->IsIndex() && !node->IsAttributeDirectory())
node->CopyTo(copyTo, source);
node->CopyTo(copyTo, &source);
gHashtable.Release(node);
gMissing.Release(node);
}
}
@@ -802,12 +842,11 @@ main(int argc, char **argv)
checkStructure(disk);
if (argv[1])
copyInodes(argv[1]);
copyInodes(disk, argv[1]);
//disk.WriteBootBlock();
//disk.BlockBitmap()->CompareWithBackup();
gHashtable.MakeEmpty();
gMissing.MakeEmpty();
gLogged.MakeEmpty();
+2 -1
View File
@@ -79,7 +79,8 @@ ScreenSaverFilter::SetEnabled(bool enabled)
ScreenSaverWindow::ScreenSaverWindow(BRect frame)
: BDirectWindow(frame, "ScreenSaver Window",
B_NO_BORDER_WINDOW_LOOK, kWindowScreenFeel,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE, B_ALL_WORKSPACES),
B_NOT_RESIZABLE | B_NOT_MOVABLE | B_NOT_MINIMIZABLE
| B_NOT_ZOOMABLE | B_NOT_CLOSABLE, B_ALL_WORKSPACES),
fSaver(NULL)
{
frame.OffsetTo(0, 0);
+2 -1
View File
@@ -54,7 +54,8 @@ BBufferGroup::BBufferGroup(size_t size, int32 count, uint32 placement,
// don't allow all placement parameter values
if (placement != B_ANY_ADDRESS && placement != B_ANY_KERNEL_ADDRESS) {
ERROR("BBufferGroup: placement != B_ANY_ADDRESS "
"&& placement != B_ANY_KERNEL_ADDRESS (0x%08lx)\n", placement);
"&& placement != B_ANY_KERNEL_ADDRESS (0x%#" B_PRIx32 ")\n",
placement);
placement = B_ANY_ADDRESS;
}
+7 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2010, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2010-2012, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2002-2003, Marcus Overhagen, <Marcus@Overhagen.de>.
* Distributed under the terms of the MIT License.
*/
@@ -82,7 +82,7 @@ BBufferProducer::GetLatency(bigtime_t* _latency)
{
CALLED();
// The default implementation of GetLatency() finds the maximum
// latency of your currently-available outputs by iterating over
// latency of your currently-available outputs by iterating over
// them, and returns that value in outLatency
int32 cookie;
@@ -95,7 +95,7 @@ BBufferProducer::GetLatency(bigtime_t* _latency)
while (GetNextOutput(&cookie, &output) == B_OK) {
if (output.destination == media_destination::null)
continue;
if (output.node.node == fNodeID) {
// avoid port writes (deadlock) if loopback connection
if (fConsumerThis == NULL)
@@ -113,7 +113,8 @@ BBufferProducer::GetLatency(bigtime_t* _latency)
*_latency = latency;
}
}
printf("BBufferProducer::GetLatency: node %ld, name \"%s\" has max latency %Ld\n", fNodeID, fName, *_latency);
printf("BBufferProducer::GetLatency: node %" B_PRId32 ", name \"%s\" has "
"max latency %" B_PRId64 "\n", fNodeID, fName, *_latency);
return B_OK;
}
@@ -276,7 +277,7 @@ BBufferProducer::HandleMessage(int32 message, const void* data, size_t size)
= media_request_info::B_SET_OUTPUT_BUFFERS_FOR;
replycommand.info.change_tag = command->change_tag;
replycommand.info.status = status;
replycommand.info.cookie = (int32)group;
replycommand.info.cookie = group;
replycommand.info.user_data = command->user_data;
replycommand.info.source = command->source;
replycommand.info.destination = command->destination;
@@ -544,7 +545,7 @@ BBufferProducer::FindSeekTag(const media_destination& destination,
request.destination = destination;
request.target_time = targetTime;
request.flags = flags;
status_t status = QueryPort(destination.port, CONSUMER_SEEK_TAG_REQUESTED,
&request, sizeof(request), &reply, sizeof(reply));
if (status != B_OK)
+3 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2009, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2009-2012, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT license.
*/
@@ -367,7 +367,8 @@ BControllable::StartControlPanel(BMessenger* _messenger)
ERROR("BControllable::StartControlPanel Error launching application\n");
return B_BAD_VALUE;
}
printf("BControllable::StartControlPanel done with id: %ld\n", team);
printf("BControllable::StartControlPanel done with id: %" B_PRId32 "\n",
team);
if (_messenger)
*_messenger = BMessenger(NULL, team);
+12 -10
View File
@@ -134,8 +134,8 @@ SendToPort(port_id sendPort, int32 msgCode, command_data* msg, size_t size)
status_t status = write_port_etc(sendPort, msgCode, msg, size,
B_RELATIVE_TIMEOUT, TIMEOUT);
if (status != B_OK) {
ERROR("SendToPort: write_port failed, msgcode 0x%lx, port %ld: %s\n",
msgCode, sendPort, strerror(status));
ERROR("SendToPort: write_port failed, msgcode 0x%" B_PRIx32 ", port %"
B_PRId32 ": %s\n", msgCode, sendPort, strerror(status));
if (status == B_BAD_PORT_ID && sendPort == sMediaServerPort) {
find_media_server_port();
sendPort = sMediaServerPort;
@@ -149,8 +149,9 @@ SendToPort(port_id sendPort, int32 msgCode, command_data* msg, size_t size)
status = write_port_etc(sendPort, msgCode, msg, size,
B_RELATIVE_TIMEOUT, TIMEOUT);
if (status != B_OK) {
ERROR("SendToPort: retrying write_port failed, msgCode 0x%lx, "
"port %ld: %s\n", msgCode, sendPort, strerror(status));
ERROR("SendToPort: retrying write_port failed, msgCode 0x%" B_PRIx32
", port %" B_PRId32 ": %s\n", msgCode, sendPort,
strerror(status));
return status;
}
}
@@ -165,8 +166,8 @@ QueryPort(port_id requestPort, int32 msgCode, request_data* request,
status_t status = write_port_etc(requestPort, msgCode, request, requestSize,
B_RELATIVE_TIMEOUT, TIMEOUT);
if (status != B_OK) {
ERROR("QueryPort: write_port failed, msgcode 0x%lx, port %ld: %s\n",
msgCode, requestPort, strerror(status));
ERROR("QueryPort: write_port failed, msgcode 0x%" B_PRIx32 ", port %"
B_PRId32 ": %s\n", msgCode, requestPort, strerror(status));
if (status == B_BAD_PORT_ID && requestPort == sMediaServerPort) {
find_media_server_port();
@@ -181,8 +182,9 @@ QueryPort(port_id requestPort, int32 msgCode, request_data* request,
status = write_port_etc(requestPort, msgCode, request, requestSize,
B_RELATIVE_TIMEOUT, TIMEOUT);
if (status != B_OK) {
ERROR("QueryPort: retrying write_port failed, msgcode 0x%lx, port "
"%ld: %s\n", msgCode, requestPort, strerror(status));
ERROR("QueryPort: retrying write_port failed, msgcode 0x%" B_PRIx32
", port %" B_PRId32 ": %s\n", msgCode, requestPort,
strerror(status));
return status;
}
}
@@ -191,8 +193,8 @@ QueryPort(port_id requestPort, int32 msgCode, request_data* request,
status = read_port_etc(request->reply_port, &code, reply, replySize,
B_RELATIVE_TIMEOUT, TIMEOUT);
if (status < B_OK) {
ERROR("QueryPort: read_port failed, msgcode 0x%lx, port %ld: %s\n",
msgCode, request->reply_port, strerror(status));
ERROR("QueryPort: read_port failed, msgcode 0x%" B_PRIx32 ", port %"
B_PRId32 ": %s\n", msgCode, request->reply_port, strerror(status));
}
return status < B_OK ? status : reply->result;
+13 -12
View File
@@ -85,8 +85,8 @@ DormantNodeManager::~DormantNodeManager()
for (; iterator != fAddOnMap.end(); iterator++) {
loaded_add_on_info& info = iterator->second;
ERROR("Forcing unload of add-on id %ld with usecount %ld\n",
info.add_on->AddonID(), info.use_count);
ERROR("Forcing unload of add-on id %" B_PRId32 " with usecount %"
B_PRId32 "\n", info.add_on->AddonID(), info.use_count);
_UnloadAddOn(info.add_on, info.image);
}
}
@@ -95,7 +95,7 @@ DormantNodeManager::~DormantNodeManager()
BMediaAddOn*
DormantNodeManager::GetAddOn(media_addon_id id)
{
TRACE("DormantNodeManager::GetAddon, id %ld\n", id);
TRACE("DormantNodeManager::GetAddon, id %" B_PRId32 "\n", id);
// first try to use a already loaded add-on
BMediaAddOn* addOn = _LookupAddOn(id);
@@ -107,8 +107,8 @@ DormantNodeManager::GetAddOn(media_addon_id id)
// ok, it's not loaded, try to get the path
BPath path;
if (FindAddOnPath(&path, id) != B_OK) {
ERROR("DormantNodeManager::GetAddon: can't find path for add-on "
"%ld\n", id);
ERROR("DormantNodeManager::GetAddon: can't find path for add-on %"
B_PRId32 "\n", id);
return NULL;
}
@@ -116,8 +116,8 @@ DormantNodeManager::GetAddOn(media_addon_id id)
BMediaAddOn* newAddOn;
image_id image;
if (_LoadAddOn(path.Path(), id, &newAddOn, &image) != B_OK) {
ERROR("DormantNodeManager::GetAddon: can't load add-on %ld from path "
"%s\n",id, path.Path());
ERROR("DormantNodeManager::GetAddon: can't load add-on %" B_PRId32
" from path %s\n",id, path.Path());
return NULL;
}
@@ -154,13 +154,14 @@ DormantNodeManager::GetAddOn(media_addon_id id)
void
DormantNodeManager::PutAddOn(media_addon_id id)
{
TRACE("DormantNodeManager::PutAddon, id %ld\n", id);
TRACE("DormantNodeManager::PutAddon, id %" B_PRId32 "\n", id);
BAutolock locker(fLock);
AddOnMap::iterator found = fAddOnMap.find(id);
if (found == fAddOnMap.end()) {
ERROR("DormantNodeManager::PutAddon: failed to find add-on %ld\n", id);
ERROR("DormantNodeManager::PutAddon: failed to find add-on %" B_PRId32
"\n", id);
return;
}
@@ -194,7 +195,7 @@ DormantNodeManager::PutAddOnDelayed(media_addon_id id)
media_addon_id
DormantNodeManager::RegisterAddOn(const char* path)
{
TRACE("DormantNodeManager::RegisterAddon, path %s\n",path);
TRACE("DormantNodeManager::RegisterAddon, path %s\n", path);
entry_ref ref;
status_t status = get_ref_for_path(path, &ref);
@@ -222,7 +223,7 @@ DormantNodeManager::RegisterAddOn(const char* path)
return 0;
}
TRACE("DormantNodeManager::RegisterAddon finished with id %ld\n",
TRACE("DormantNodeManager::RegisterAddon finished with id %" B_PRId32 "\n",
reply.add_on_id);
return reply.add_on_id;
@@ -233,7 +234,7 @@ DormantNodeManager::RegisterAddOn(const char* path)
void
DormantNodeManager::UnregisterAddOn(media_addon_id id)
{
TRACE("DormantNodeManager::UnregisterAddon id %ld\n",id);
TRACE("DormantNodeManager::UnregisterAddon id %" B_PRId32 "\n", id);
ASSERT(id > 0);
port_id port = find_port(MEDIA_SERVER_PORT_NAME);
+61 -62
View File
@@ -114,7 +114,7 @@ media_source::~media_source()
media_source media_source::null(-1, -1);
// #pragma mark -
// #pragma mark -
bool
@@ -183,7 +183,7 @@ operator<(const media_node& a, const media_node& b)
}
// #pragma mark -
// #pragma mark -
media_multi_audio_format media_raw_audio_format::wildcard;
@@ -352,7 +352,7 @@ multistream_format_matches(const media_multistream_format& a,
switch ((a.format != 0) ? a.format : b.format) {
default:
return true; // TODO: really?
case media_multistream_format::B_VID:
if (a.u.vid.frame_rate != 0 && b.u.vid.frame_rate != 0
&& a.u.vid.frame_rate != b.u.vid.frame_rate) {
@@ -387,7 +387,7 @@ multistream_format_matches(const media_multistream_format& a,
return false;
}
return true;
case media_multistream_format::B_AVI:
if (a.u.avi.us_per_frame != 0 && b.u.avi.us_per_frame != 0
&& a.u.avi.us_per_frame != b.u.avi.us_per_frame) {
@@ -444,10 +444,10 @@ encoded_audio_format_matches(const media_encoded_audio_format& a,
return false;
if (!multi_audio_info_matches(a.multi_info, b.multi_info))
return false;
if (a.encoding == 0 && b.encoding == 0)
return true; // can't compare
switch((a.encoding != 0) ? a.encoding : b.encoding) {
case media_encoded_audio_format::B_ANY:
default:
@@ -488,7 +488,7 @@ encoded_video_format_matches(const media_encoded_video_format& a,
if (a.encoding == 0 && b.encoding == 0)
return true; // can't compare
switch((a.encoding != 0) ? a.encoding : b.encoding) {
case media_encoded_video_format::B_ANY:
default:
@@ -592,7 +592,7 @@ multistream_format_specialize(media_multistream_format* format,
format->flags = other->flags;
if (format->format == 0)
format->format = other->format;
switch (format->format) {
case media_multistream_format::B_VID:
if (format->u.vid.frame_rate == 0)
@@ -636,7 +636,8 @@ multistream_format_specialize(media_multistream_format* format,
default:
ERROR("media_format::SpecializeTo can't specialize "
"media_multistream_format of format %ld\n", format->format);
"media_multistream_format of format %" B_PRId32 "\n",
format->format);
}
}
@@ -688,21 +689,21 @@ media_format::Matches(const media_format* other) const
// TODO: How do we compare two formats with no type?
return true;
}
if (type != 0 && other->type != 0 && type != other->type)
return false;
switch ((type != 0) ? type : other->type) {
case B_MEDIA_RAW_AUDIO:
return multi_audio_format_matches(u.raw_audio, other->u.raw_audio);
case B_MEDIA_RAW_VIDEO:
return raw_video_format_matches(u.raw_video, other->u.raw_video);
case B_MEDIA_MULTISTREAM:
return multistream_format_matches(u.multistream,
other->u.multistream);
case B_MEDIA_ENCODED_AUDIO:
return encoded_audio_format_matches(u.encoded_audio,
other->u.encoded_audio);
@@ -710,7 +711,7 @@ media_format::Matches(const media_format* other) const
case B_MEDIA_ENCODED_VIDEO:
return encoded_video_format_matches(u.encoded_video,
other->u.encoded_video);
default:
return true; // TODO: really?
}
@@ -727,16 +728,16 @@ media_format::SpecializeTo(const media_format* otherFormat)
"wildcard format\n");
return;
}
if (type == 0)
type = otherFormat->type;
switch (type) {
case B_MEDIA_RAW_AUDIO:
multi_audio_format_specialize(&u.raw_audio,
&otherFormat->u.raw_audio);
return;
case B_MEDIA_RAW_VIDEO:
raw_video_format_specialize(&u.raw_video,
&otherFormat->u.raw_video);
@@ -746,7 +747,7 @@ media_format::SpecializeTo(const media_format* otherFormat)
multistream_format_specialize(&u.multistream,
&otherFormat->u.multistream);
return;
case B_MEDIA_ENCODED_AUDIO:
encoded_audio_format_specialize(&u.encoded_audio,
&otherFormat->u.encoded_audio);
@@ -756,7 +757,7 @@ media_format::SpecializeTo(const media_format* otherFormat)
encoded_video_format_specialize(&u.encoded_video,
&otherFormat->u.encoded_video);
return;
default:
ERROR("media_format::SpecializeTo can't specialize format "
"type %d\n", type);
@@ -769,7 +770,7 @@ media_format::SetMetaData(const void* data, size_t size)
{
if (!data || size < 0 || size > META_DATA_MAX_SIZE)
return B_BAD_VALUE;
void* new_addr;
area_id new_area;
if (size < META_DATA_AREA_MIN_SIZE) {
@@ -792,9 +793,9 @@ media_format::SetMetaData(const void* data, size_t size)
meta_data = new_addr;
meta_data_size = size;
meta_data_area = new_area;
memcpy(meta_data, data, size);
if (meta_data_area > 0)
set_area_protection(meta_data_area, B_READ_AREA);
@@ -857,7 +858,7 @@ media_format::operator=(const media_format& clone)
// clone or copy the meta data
if (clone.meta_data) {
if (clone.meta_data_area != B_BAD_VALUE) {
meta_data_area = clone_area("meta_data_clone_area", &meta_data,
meta_data_area = clone_area("meta_data_clone_area", &meta_data,
B_ANY_ADDRESS, B_READ_AREA, clone.meta_data_area);
if (meta_data_area < 0) {
// whoops, we just lost our meta data
@@ -1011,7 +1012,7 @@ operator==(const media_multistream_format& a,
switch (a.format) {
case media_multistream_format::B_VID:
return a.u.vid == b.u.vid;
case media_multistream_format::B_AVI:
return a.u.avi == b.u.avi;
@@ -1031,30 +1032,30 @@ operator==(const media_format& a, const media_format& b)
|| a.deny_flags != b.deny_flags) {
return false;
}
switch (a.type) {
case B_MEDIA_RAW_AUDIO:
return a.u.raw_audio == b.u.raw_audio;
case B_MEDIA_RAW_VIDEO:
return a.u.raw_video == b.u.raw_video;
case B_MEDIA_MULTISTREAM:
return a.u.multistream == b.u.multistream;
case B_MEDIA_ENCODED_AUDIO:
return a.u.encoded_audio == b.u.encoded_audio;
case B_MEDIA_ENCODED_VIDEO:
return a.u.encoded_video == b.u.encoded_video;
default:
return true; // TODO: really?
}
}
// #pragma mark -
// #pragma mark -
/*! return \c true if a and b are compatible (accounting for wildcards)
@@ -1072,17 +1073,18 @@ string_for_format(const media_format& f, char* buf, size_t size)
{
char encoding[10]; /* maybe Be wanted to use some 4CCs ? */
const char* videoOrientation = "0"; /* I'd use "NC", R5 uses 0. */
if (buf == NULL)
return false;
switch (f.type) {
case B_MEDIA_RAW_AUDIO:
snprintf(buf, size,
"raw_audio;%g;%ld;0x%lx;%ld;0x%lx;0x%08lx;%d;0x%04x",
f.u.raw_audio.frame_rate,
f.u.raw_audio.channel_count,
f.u.raw_audio.format,
f.u.raw_audio.byte_order,
"raw_audio;%g;%" B_PRIu32 ";0x%" B_PRIx32 ";%" B_PRIu32 ";0x%"
B_PRIxSIZE ";0x%#" B_PRIx32 ";%d;0x%04x",
f.u.raw_audio.frame_rate,
f.u.raw_audio.channel_count,
f.u.raw_audio.format,
f.u.raw_audio.byte_order,
f.u.raw_audio.buffer_size,
f.u.raw_audio.channel_mask,
f.u.raw_audio.valid_bits,
@@ -1093,9 +1095,8 @@ string_for_format(const media_format& f, char* buf, size_t size)
videoOrientation = "TopLR";
else if (f.u.raw_video.orientation == B_VIDEO_BOTTOM_LEFT_RIGHT)
videoOrientation = "BotLR";
// snprintf(buf, size, "raw_video;%g;%ld;%ld;%ld;%s;%d;%d;%d;%d;%d;%d;"
// "%d;%d",
snprintf(buf, size, "raw_video;%g;0x%x;%ld;%ld;%ld;%ld;%s;%d;%d",
snprintf(buf, size, "raw_video;%g;0x%x;%" B_PRIu32 ";%" B_PRIu32 ";%"
B_PRIu32 ";%" B_PRIu32 ";%s;%d;%d",
f.u.raw_video.field_rate,
f.u.raw_video.display.format,
f.u.raw_video.interlace,
@@ -1108,21 +1109,20 @@ string_for_format(const media_format& f, char* buf, size_t size)
return true;
case B_MEDIA_ENCODED_AUDIO:
snprintf(encoding, 10, "%d", f.u.encoded_audio.encoding);
snprintf(buf, size,
"caudio;%s;%g;%ld;(%g;%ld;0x%lx;%ld;0x%lx;0x%08lx;%d;0x%04x)",
encoding, // f.u.encoded_audio.encoding,
f.u.encoded_audio.bit_rate,
f.u.encoded_audio.frame_size,
// (
f.u.encoded_audio.output.frame_rate,
f.u.encoded_audio.output.channel_count,
f.u.encoded_audio.output.format,
f.u.encoded_audio.output.byte_order,
snprintf(buf, size,
"caudio;%s;%g;%ld;(%g;%" B_PRIu32 ";0x%" B_PRIx32 ";%" B_PRIu32
";0x%" B_PRIxSIZE ";0x%08" B_PRIx32 ";%d;0x%04x)",
encoding,
f.u.encoded_audio.bit_rate,
f.u.encoded_audio.frame_size,
f.u.encoded_audio.output.frame_rate,
f.u.encoded_audio.output.channel_count,
f.u.encoded_audio.output.format,
f.u.encoded_audio.output.byte_order,
f.u.encoded_audio.output.buffer_size,
f.u.encoded_audio.multi_info.channel_mask,
f.u.encoded_audio.multi_info.valid_bits,
f.u.encoded_audio.multi_info.matrix_mask);
// )
return true;
case B_MEDIA_ENCODED_VIDEO:
snprintf(encoding, 10, "%d", f.u.encoded_video.encoding);
@@ -1130,23 +1130,22 @@ string_for_format(const media_format& f, char* buf, size_t size)
videoOrientation = "TopLR";
else if (f.u.encoded_video.output.orientation == B_VIDEO_BOTTOM_LEFT_RIGHT)
videoOrientation = "BotLR";
snprintf(buf, size,
"cvideo;%s;%g;%g;%ld;(%g;0x%x;%ld;%ld;%ld;%ld;%s;%d;%d)",
encoding,
f.u.encoded_video.avg_bit_rate,
f.u.encoded_video.max_bit_rate,
snprintf(buf, size,
"cvideo;%s;%g;%g;%" B_PRIuSIZE ";(%g;0x%x;%" B_PRIu32 ";%" B_PRIu32
";%" B_PRIu32 ";%" B_PRIu32 ";%s;%d;%d)",
encoding,
f.u.encoded_video.avg_bit_rate,
f.u.encoded_video.max_bit_rate,
f.u.encoded_video.frame_size,
// (
f.u.encoded_video.output.field_rate,
f.u.encoded_video.output.display.format,
f.u.encoded_video.output.interlace,
f.u.encoded_video.output.display.line_width,
f.u.encoded_video.output.display.line_width,
f.u.encoded_video.output.display.line_count,
f.u.encoded_video.output.first_active,
videoOrientation,
f.u.encoded_video.output.pixel_width_aspect,
f.u.encoded_video.output.pixel_height_aspect);
// )
return true;
default:
snprintf(buf, size, "%d-", f.type);
@@ -1232,7 +1231,7 @@ shutdown_media_server(bigtime_t timeout,
BMessage msg(B_QUIT_REQUESTED);
BMessage reply;
status_t err;
if ((err = msg.AddBool("be:_user_request", true)) != B_OK)
return err;
@@ -1266,7 +1265,7 @@ shutdown_media_server(bigtime_t timeout,
progress(40, "Waiting for media_server to quit.", cookie);
snooze(200000);
}
if (be_roster->IsRunning(B_MEDIA_ADDON_SERVER_SIGNATURE)) {
progress(50, "Waiting for media_addon_server to quit.", cookie);
snooze(200000);
@@ -1310,7 +1309,7 @@ launch_media_server(uint32 flags)
err = B_MEDIA_SYSTEM_FAILURE;
for (int i = 0; i < 15; i++) {
snooze(2000000);
BMessage msg(1); // this is a hack
BMessage reply;
BMessenger messenger(B_MEDIA_ADDON_SERVER_SIGNATURE);
+45 -42
View File
@@ -87,7 +87,7 @@ BMediaEventLooper::Start(bigtime_t performance_time)
// This hook function is called when a node is started
// by a call to the BMediaRoster. The specified
// performanceTime, the time at which the node
// should start running, may be in the future.
// should start running, may be in the future.
fEventQueue.AddEvent(media_timed_event(performance_time, BTimedEventQueue::B_START));
}
@@ -97,15 +97,15 @@ BMediaEventLooper::Stop(bigtime_t performance_time,
bool immediate)
{
CALLED();
// This hook function is called when a node is stopped
// by a call to the BMediaRoster. The specified performanceTime,
// the time at which the node should stop, may be in the future.
// If immediate is true, your node should ignore the performanceTime
// This hook function is called when a node is stopped
// by a call to the BMediaRoster. The specified performanceTime,
// the time at which the node should stop, may be in the future.
// If immediate is true, your node should ignore the performanceTime
// value and synchronously stop performance. When Stop() returns,
// you're promising not to write into any BBuffers you may have
// received from your downstream consumers, and you promise not
// received from your downstream consumers, and you promise not
// to send any more buffers until Start() is called again.
if (immediate) {
// always be sure to add to the front of the queue so we can make sure it is
// handled before any buffers are sent!
@@ -120,11 +120,11 @@ BMediaEventLooper::Seek(bigtime_t media_time,
bigtime_t performance_time)
{
CALLED();
// This hook function is called when a node is asked to seek to
// the specified mediaTime by a call to the BMediaRoster.
// The specified performanceTime, the time at which the node
// should begin the seek operation, may be in the future.
fEventQueue.AddEvent(media_timed_event(performance_time, BTimedEventQueue::B_SEEK, NULL,
// This hook function is called when a node is asked to seek to
// the specified mediaTime by a call to the BMediaRoster.
// The specified performanceTime, the time at which the node
// should begin the seek operation, may be in the future.
fEventQueue.AddEvent(media_timed_event(performance_time, BTimedEventQueue::B_SEEK, NULL,
BTimedEventQueue::B_NO_CLEANUP, 0, media_time, NULL));
}
@@ -134,18 +134,18 @@ BMediaEventLooper::TimeWarp(bigtime_t at_real_time,
bigtime_t to_performance_time)
{
CALLED();
// This hook function is called when the time source to which the
// This hook function is called when the time source to which the
// node is slaved is repositioned (via a seek operation) such that
// there will be a sudden jump in the performance time progression
// as seen by the node. The to_performance_time argument indicates
// there will be a sudden jump in the performance time progression
// as seen by the node. The to_performance_time argument indicates
// the new performance time; the change should occur at the real
// time specified by the at_real_time argument.
// time specified by the at_real_time argument.
// place in the realtime queue
fRealTimeQueue.AddEvent(media_timed_event(at_real_time, BTimedEventQueue::B_WARP,
fRealTimeQueue.AddEvent(media_timed_event(at_real_time, BTimedEventQueue::B_WARP,
NULL, BTimedEventQueue::B_NO_CLEANUP, 0, to_performance_time, NULL));
// BeBook: Your implementation of TimeWarp() should call through to BMediaNode::TimeWarp()
// BeBook: Your implementation of TimeWarp() should call through to BMediaNode::TimeWarp()
// BeBook: as well as all other inherited forms of TimeWarp()
// XXX should we do this here?
BMediaNode::TimeWarp(at_real_time, to_performance_time);
@@ -168,15 +168,16 @@ BMediaEventLooper::SetRunMode(run_mode mode)
CALLED();
// The SetRunMode() hook function is called when someone requests that your node's run mode be changed.
// bump or reduce priority when switching from/to offline run mode
int32 priority;
// bump or reduce priority when switching from/to offline run mode
int32 priority;
priority = (mode == B_OFFLINE) ? min_c(B_NORMAL_PRIORITY, fSetPriority) : fSetPriority;
if (priority != fCurrentPriority) {
fCurrentPriority = priority;
if (fControlThread > 0) {
set_thread_priority(fControlThread, fCurrentPriority);
fSchedulingLatency = estimate_max_scheduling_latency(fControlThread);
printf("BMediaEventLooper: SchedulingLatency is %Ld\n", fSchedulingLatency);
printf("BMediaEventLooper: SchedulingLatency is %" B_PRId64 "\n",
fSchedulingLatency);
}
}
@@ -188,9 +189,9 @@ BMediaEventLooper::SetRunMode(run_mode mode)
BMediaEventLooper::CleanUpEvent(const media_timed_event *event)
{
CALLED();
// Implement this function to clean up after custom events you've created
// and added to your queue. It's called when a custom event is removed from
// the queue, to let you handle any special tidying-up that the event might require.
// Implement this function to clean up after custom events you've created
// and added to your queue. It's called when a custom event is removed from
// the queue, to let you handle any special tidying-up that the event might require.
}
@@ -220,8 +221,8 @@ BMediaEventLooper::ControlLoop()
if (RunState() == B_QUITTING)
return;
// BMediaEventLooper compensates your performance time by adding the event latency
// (see SetEventLatency()) and the scheduling latency (or, for real-time events,
// only the scheduling latency).
// (see SetEventLatency()) and the scheduling latency (or, for real-time events,
// only the scheduling latency).
latency = fEventLatency + fSchedulingLatency;
waituntil = B_INFINITE_TIMEOUT;
@@ -349,17 +350,18 @@ BMediaEventLooper::SetPriority(int32 priority)
// clamp to a valid value
if (priority < 5)
priority = 5;
if (priority > 120)
priority = 120;
fSetPriority = priority;
fCurrentPriority = (RunMode() == B_OFFLINE) ? min_c(B_NORMAL_PRIORITY, fSetPriority) : fSetPriority;
if (fControlThread > 0) {
set_thread_priority(fControlThread, fCurrentPriority);
fSchedulingLatency = estimate_max_scheduling_latency(fControlThread);
printf("BMediaEventLooper: SchedulingLatency is %Ld\n", fSchedulingLatency);
printf("BMediaEventLooper: SchedulingLatency is %" B_PRId64 "\n",
fSchedulingLatency);
}
return B_OK;
@@ -375,7 +377,7 @@ BMediaEventLooper::SetRunState(run_state state)
// also needed for correct terminating of the ControlLoop()
if (fRunState == B_QUITTING && state != B_TERMINATED)
return;
fRunState = state;
}
@@ -413,10 +415,10 @@ void
BMediaEventLooper::Run()
{
CALLED();
if (fControlThread != -1)
return; // thread already running
// until now, the run state is B_UNREGISTERED, but we need to start in B_STOPPED state.
SetRunState(B_STOPPED);
@@ -427,7 +429,8 @@ BMediaEventLooper::Run()
// get latency information
fSchedulingLatency = estimate_max_scheduling_latency(fControlThread);
printf("BMediaEventLooper: SchedulingLatency is %Ld\n", fSchedulingLatency);
printf("BMediaEventLooper: SchedulingLatency is %" B_PRId64 "\n",
fSchedulingLatency);
}
@@ -438,7 +441,7 @@ BMediaEventLooper::Quit()
if (fRunState == B_TERMINATED)
return;
SetRunState(B_QUITTING);
close_port(ControlPort());
if (fControlThread != -1) {
@@ -463,23 +466,23 @@ BMediaEventLooper::DispatchEvent(const media_timed_event *event,
case BTimedEventQueue::B_START:
SetRunState(B_STARTED);
break;
case BTimedEventQueue::B_STOP:
case BTimedEventQueue::B_STOP:
SetRunState(B_STOPPED);
break;
case BTimedEventQueue::B_SEEK:
/* nothing */
break;
case BTimedEventQueue::B_WARP:
/* nothing */
break;
default:
break;
}
_DispatchCleanUp(event);
}
@@ -513,8 +516,8 @@ BMediaEventLooper::_DispatchCleanUp(const media_timed_event *event)
{
PRINT(6, "CALLED BMediaEventLooper::_DispatchCleanUp()\n");
// this function to clean up after custom events you've created
if (event->cleanup >= BTimedEventQueue::B_USER_CLEANUP)
// this function to clean up after custom events you've created
if (event->cleanup >= BTimedEventQueue::B_USER_CLEANUP)
CleanUpEvent(event);
}
+12 -12
View File
@@ -1,7 +1,7 @@
/*
* Copyright 2004-2007, Marcus Overhagen. All rights reserved.
* Copyright 2008, Maurice Kalinowski. All rights reserved.
* Copyright 2009, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2009-2012, Axel Dörfler, axeld@pinc-software.de.
*
* Distributed under the terms of the MIT License.
*/
@@ -103,8 +103,8 @@ MediaExtractor::MediaExtractor(BDataIO* source, int32 flags)
fStreamInfo[i].cookie = 0;
fStreamInfo[i].hasCookie = false;
fStreamInfo[i].status = B_ERROR;
ERROR("MediaExtractor::MediaExtractor: AllocateCookie for stream "
"%ld failed\n", i);
ERROR("MediaExtractor::MediaExtractor: AllocateCookie for stream %"
B_PRId32 " failed\n", i);
} else
fStreamInfo[i].hasCookie = true;
}
@@ -122,7 +122,7 @@ MediaExtractor::MediaExtractor(BDataIO* source, int32 flags)
!= B_OK) {
fStreamInfo[i].status = B_ERROR;
ERROR("MediaExtractor::MediaExtractor: GetStreamInfo for "
"stream %ld failed\n", i);
"stream %" B_PRId32 " failed\n", i);
}
}
@@ -330,7 +330,7 @@ MediaExtractor::CreateDecoder(int32 stream, Decoder** _decoder,
status_t status = fStreamInfo[stream].status;
if (status != B_OK) {
ERROR("MediaExtractor::CreateDecoder can't create decoder for "
"stream %ld: %s\n", stream, strerror(status));
"stream %" B_PRId32 ": %s\n", stream, strerror(status));
return status;
}
@@ -346,8 +346,8 @@ MediaExtractor::CreateDecoder(int32 stream, Decoder** _decoder,
sizeof(formatString));
ERROR("MediaExtractor::CreateDecoder gPluginManager.CreateDecoder "
"failed for stream %ld, format: %s: %s\n", stream, formatString,
strerror(status));
"failed for stream %" B_PRId32 ", format: %s: %s\n", stream,
formatString, strerror(status));
#endif
return status;
}
@@ -357,7 +357,7 @@ MediaExtractor::CreateDecoder(int32 stream, Decoder** _decoder,
if (chunkProvider == NULL) {
gPluginManager.DestroyDecoder(decoder);
ERROR("MediaExtractor::CreateDecoder can't create chunk provider "
"for stream %ld\n", stream);
"for stream %" B_PRId32 "\n", stream);
return B_NO_MEMORY;
}
@@ -367,16 +367,16 @@ MediaExtractor::CreateDecoder(int32 stream, Decoder** _decoder,
fStreamInfo[stream].infoBuffer, fStreamInfo[stream].infoBufferSize);
if (status != B_OK) {
gPluginManager.DestroyDecoder(decoder);
ERROR("MediaExtractor::CreateDecoder Setup failed for stream %ld: %s\n",
stream, strerror(status));
ERROR("MediaExtractor::CreateDecoder Setup failed for stream %" B_PRId32
": %s\n", stream, strerror(status));
return status;
}
status = gPluginManager.GetDecoderInfo(decoder, codecInfo);
if (status != B_OK) {
gPluginManager.DestroyDecoder(decoder);
ERROR("MediaExtractor::CreateDecoder GetCodecInfo failed for stream "
"%ld: %s\n", stream, strerror(status));
ERROR("MediaExtractor::CreateDecoder GetCodecInfo failed for stream %"
B_PRId32 ": %s\n", stream, strerror(status));
return status;
}
+215 -179
View File
@@ -1,6 +1,6 @@
/*
* Copyright 2008 Maurice Kalinowski, haiku@kaldience.com
* Copyright 2009, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2009-2012, Axel Dörfler, axeld@pinc-software.de.
*
* All rights reserved. Distributed under the terms of the MIT License.
*/
@@ -132,8 +132,8 @@ BMediaRosterEx::SaveNodeConfiguration(BMediaNode* node)
// NOTE: This node could have been created by an application,
// it does not mean there is an error.
// TODO: this check incorrectly triggers on BeOS R5 BT848 node
TRACE("BMediaRosterEx::SaveNodeConfiguration node %ld not instantiated "
"from BMediaAddOn!\n", node->ID());
TRACE("BMediaRosterEx::SaveNodeConfiguration node %" B_PRId32 " not "
"instantiated from BMediaAddOn!\n", node->ID());
return B_ERROR;
}
@@ -141,7 +141,8 @@ BMediaRosterEx::SaveNodeConfiguration(BMediaNode* node)
// TODO: fix this
printf("### BMediaRosterEx::SaveNodeConfiguration should save addon-id "
"%ld, flavor-id %ld config NOW!\n", addonID, flavorID);
"%" B_PRId32 ", flavor-id %" B_PRId32 " config NOW!\n", addonID,
flavorID);
return B_OK;
}
@@ -153,7 +154,8 @@ BMediaRosterEx::LoadNodeConfiguration(media_addon_id addonID, int32 flavorID,
// TODO: fix this
_msg->MakeEmpty(); // to be fully R5 compliant
printf("### BMediaRosterEx::LoadNodeConfiguration should load addon-id "
"%ld, flavor-id %ld config NOW!\n", addonID, flavorID);
"%" B_PRId32 ", flavor-id %" B_PRId32 " config NOW!\n", addonID,
flavorID);
return B_OK;
}
@@ -199,7 +201,8 @@ BMediaRosterEx::ReleaseNodeAll(const media_node& node)
if (node.kind & NODE_KIND_NO_REFCOUNTING) {
printf("BMediaRoster::ReleaseNodeAll, trying to release reference "
"counting disabled timesource, node %ld, port %ld, team %ld\n",
"counting disabled timesource, node %" B_PRId32 ", port %" B_PRId32
", team %" B_PRId32 "\n",
node.node, node.port, BPrivate::current_team());
return B_OK;
}
@@ -211,14 +214,16 @@ BMediaRosterEx::ReleaseNodeAll(const media_node& node)
request.node = node;
request.team = BPrivate::current_team();
TRACE("BMediaRoster::ReleaseNodeAll, node %ld, port %ld, team %ld\n",
TRACE("BMediaRoster::ReleaseNodeAll, node %" B_PRId32 ", port %" B_PRId32
", team %" B_PRId32 "\n",
node.node, node.port, BPrivate::current_team());
rv = QueryServer(SERVER_RELEASE_NODE_ALL, &request, sizeof(request), &reply,
sizeof(reply));
if (rv != B_OK) {
ERROR("BMediaRoster::ReleaseNodeAll FAILED, node %ld, port %ld, team "
"%ld!\n", node.node, node.port, BPrivate::current_team());
ERROR("BMediaRoster::ReleaseNodeAll FAILED, node %" B_PRId32 ", port %"
B_PRId32 ", team %" B_PRId32 "!\n", node.node, node.port,
BPrivate::current_team());
}
return rv;
}
@@ -294,11 +299,11 @@ BMediaRosterEx::GetAllOutputs(const media_node& node, List<media_output>* list)
status_t rv;
status_t result;
PRINT(4, "BMediaRosterEx::GetAllOutputs() node %ld, port %ld\n", node.node,
node.port);
PRINT(4, "BMediaRosterEx::GetAllOutputs() node %" B_PRId32 ", port %"
B_PRId32 "\n", node.node, node.port);
if (!(node.kind & B_BUFFER_PRODUCER)) {
ERROR("BMediaRosterEx::GetAllOutputs: node %ld is not a "
ERROR("BMediaRosterEx::GetAllOutputs: node %" B_PRId32 " is not a "
"B_BUFFER_PRODUCER\n", node.node);
return B_MEDIA_BAD_NODE;
}
@@ -320,7 +325,7 @@ BMediaRosterEx::GetAllOutputs(const media_node& node, List<media_output>* list)
result = B_ERROR;
}
#if DEBUG >= 3
PRINT(3," next cookie %ld, ", cookie);
PRINT(3," next cookie %" B_PRId32 ", ", cookie);
PRINT_OUTPUT("output ", reply.output);
#endif
}
@@ -340,7 +345,8 @@ BMediaRosterEx::GetAllOutputs(BBufferProducer* node, List<media_output>* list)
int32 cookie;
status_t result;
PRINT(4, "BMediaRosterEx::GetAllOutputs() (by pointer) node %ld, port %ld\n", node->ID(), node->ControlPort());
PRINT(4, "BMediaRosterEx::GetAllOutputs() (by pointer) node %" B_PRId32
", port %" B_PRId32 "\n", node->ID(), node->ControlPort());
result = B_OK;
cookie = 0;
@@ -354,7 +360,7 @@ BMediaRosterEx::GetAllOutputs(BBufferProducer* node, List<media_output>* list)
result = B_ERROR;
}
#if DEBUG >= 3
PRINT(3," next cookie %ld, ", cookie);
PRINT(3," next cookie %" B_PRId32 ", ", cookie);
PRINT_OUTPUT("output ", output);
#endif
}
@@ -370,11 +376,11 @@ BMediaRosterEx::GetAllInputs(const media_node& node, List<media_input>* list)
status_t rv;
status_t result;
PRINT(4, "BMediaRosterEx::GetAllInputs() node %ld, port %ld\n", node.node,
node.port);
PRINT(4, "BMediaRosterEx::GetAllInputs() node %" B_PRId32 ", port %"
B_PRId32 "\n", node.node, node.port);
if (!(node.kind & B_BUFFER_CONSUMER)) {
ERROR("BMediaRosterEx::GetAllInputs: node %ld is not a "
ERROR("BMediaRosterEx::GetAllInputs: node %" B_PRId32 " is not a "
"B_BUFFER_CONSUMER\n", node.node);
return B_MEDIA_BAD_NODE;
}
@@ -396,7 +402,7 @@ BMediaRosterEx::GetAllInputs(const media_node& node, List<media_input>* list)
result = B_ERROR;
}
#if DEBUG >= 3
PRINT(3," next cookie %ld, ", cookie);
PRINT(3," next cookie %" B_PRId32 ", ", cookie);
PRINT_OUTPUT("input ", reply.input);
#endif
}
@@ -416,7 +422,8 @@ BMediaRosterEx::GetAllInputs(BBufferConsumer* node, List<media_input>* list)
int32 cookie;
status_t result;
PRINT(4, "BMediaRosterEx::GetAllInputs() (by pointer) node %ld, port %ld\n", node->ID(), node->ControlPort());
PRINT(4, "BMediaRosterEx::GetAllInputs() (by pointer) node %" B_PRId32
", port %" B_PRId32 "\n", node->ID(), node->ControlPort());
result = B_OK;
cookie = 0;
@@ -430,7 +437,7 @@ BMediaRosterEx::GetAllInputs(BBufferConsumer* node, List<media_input>* list)
result = B_ERROR;
}
#if DEBUG >= 3
PRINT(3," next cookie %ld, ", cookie);
PRINT(3," next cookie %" B_PRId32 ", ", cookie);
PRINT_INPUT("input ", input);
#endif
}
@@ -450,7 +457,7 @@ BMediaRosterEx::PublishOutputs(const media_node& node, List<media_output>* list)
status_t rv;
count = list->CountItems();
TRACE("PublishOutputs: publishing %ld\n", count);
TRACE("PublishOutputs: publishing %" B_PRId32 "\n", count);
request.node = node;
request.count = count;
@@ -461,7 +468,7 @@ BMediaRosterEx::PublishOutputs(const media_node& node, List<media_output>* list)
request.area = create_area("publish outputs", &start_addr,
B_ANY_ADDRESS, size, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
if (request.area < B_OK) {
ERROR("PublishOutputs: failed to create area, %#lx\n",
ERROR("PublishOutputs: failed to create area, %#" B_PRIx32 "\n",
request.area);
return (status_t)request.area;
}
@@ -470,7 +477,7 @@ BMediaRosterEx::PublishOutputs(const media_node& node, List<media_output>* list)
request.area = -1;
outputs = request.outputs;
}
TRACE("PublishOutputs: area %ld\n", request.area);
TRACE("PublishOutputs: area %" B_PRId32 "\n", request.area);
int i;
for (i = 0, list->Rewind(); list->GetNext(&output); i++) {
@@ -499,7 +506,7 @@ BMediaRosterEx::PublishInputs(const media_node& node, List<media_input>* list)
status_t rv;
count = list->CountItems();
TRACE("PublishInputs: publishing %ld\n", count);
TRACE("PublishInputs: publishing %" B_PRId32 "\n", count);
request.node = node;
request.count = count;
@@ -510,7 +517,8 @@ BMediaRosterEx::PublishInputs(const media_node& node, List<media_input>* list)
request.area = create_area("publish inputs", &start_addr,
B_ANY_ADDRESS, size, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
if (request.area < B_OK) {
ERROR("PublishInputs: failed to create area, %#lx\n", request.area);
ERROR("PublishInputs: failed to create area, %#" B_PRIx32 "\n",
request.area);
return (status_t)request.area;
}
inputs = static_cast<media_input *>(start_addr);
@@ -518,7 +526,7 @@ BMediaRosterEx::PublishInputs(const media_node& node, List<media_input>* list)
request.area = -1;
inputs = request.inputs;
}
TRACE("PublishInputs: area %ld\n", request.area);
TRACE("PublishInputs: area %" B_PRId32 "\n", request.area);
int i;
for (i = 0, list->Rewind(); list->GetNext(&input); i++) {
@@ -766,8 +774,9 @@ BMediaRoster::ReleaseNode(const media_node& node)
if (node.kind & NODE_KIND_NO_REFCOUNTING) {
printf("BMediaRoster::ReleaseNode, trying to release reference "
"counting disabled timesource, node %ld, port %ld, team %ld\n",
node.node, node.port, BPrivate::current_team());
"counting disabled timesource, node %" B_PRId32 ", port %" B_PRId32
", team %" B_PRId32 "\n", node.node, node.port,
BPrivate::current_team());
return B_OK;
}
@@ -778,14 +787,16 @@ BMediaRoster::ReleaseNode(const media_node& node)
request.node = node;
request.team = BPrivate::current_team();
TRACE("BMediaRoster::ReleaseNode, node %ld, port %ld, team %ld\n",
node.node, node.port, BPrivate::current_team());
TRACE("BMediaRoster::ReleaseNode, node %" B_PRId32 ", port %" B_PRId32
", team %" B_PRId32 "\n", node.node, node.port,
BPrivate::current_team());
rv = QueryServer(SERVER_RELEASE_NODE, &request, sizeof(request), &reply,
sizeof(reply));
if (rv != B_OK) {
ERROR("BMediaRoster::ReleaseNode FAILED, node %ld, port %ld, team "
"%ld!\n", node.node, node.port, BPrivate::current_team());
ERROR("BMediaRoster::ReleaseNode FAILED, node %" B_PRId32 ", port %"
B_PRId32 ", team %" B_PRId32 "!\n", node.node, node.port,
BPrivate::current_team());
}
return rv;
}
@@ -808,13 +819,14 @@ BMediaRoster::MakeTimeSourceFor(const media_node& forNode)
}
if (IS_INVALID_NODE(forNode)) {
ERROR("BMediaRoster::MakeTimeSourceFor: for_node invalid, node %ld, "
"port %ld, kinds 0x%lx\n", forNode.node, forNode.port,
forNode.kind);
ERROR("BMediaRoster::MakeTimeSourceFor: for_node invalid, node %"
B_PRId32 ", port %" B_PRId32 ", kinds 0x%" B_PRIx32 "\n",
forNode.node, forNode.port, forNode.kind);
return NULL;
}
TRACE("BMediaRoster::MakeTimeSourceFor: node %ld enter\n", forNode.node);
TRACE("BMediaRoster::MakeTimeSourceFor: node %" B_PRId32 " enter\n",
forNode.node);
node_get_timesource_request request;
node_get_timesource_reply reply;
@@ -831,7 +843,8 @@ BMediaRoster::MakeTimeSourceFor(const media_node& forNode)
source = MediaRosterEx(this)->MakeTimeSourceObject(reply.timesource_id);
TRACE("BMediaRoster::MakeTimeSourceFor: node %ld leave\n", forNode.node);
TRACE("BMediaRoster::MakeTimeSourceFor: node %" B_PRId32 " leave\n",
forNode.node);
return source;
}
@@ -870,26 +883,26 @@ BMediaRoster::Connect(const media_source& from, const media_destination& to,
media_node destnode;
rv = GetNodeFor(NodeIDFor(from.port), &sourcenode);
if (rv != B_OK) {
ERROR("BMediaRoster::Connect: Can't find source node for port %ld\n",
from.port);
ERROR("BMediaRoster::Connect: Can't find source node for port %"
B_PRId32 "\n", from.port);
return B_MEDIA_BAD_SOURCE;
}
ReleaseNode(sourcenode);
rv = GetNodeFor(NodeIDFor(to.port), &destnode);
if (rv != B_OK) {
ERROR("BMediaRoster::Connect: Can't find destination node for port "
"%ld\n", to.port);
"%" B_PRId32 "\n", to.port);
return B_MEDIA_BAD_DESTINATION;
}
ReleaseNode(destnode);
if (!(sourcenode.kind & B_BUFFER_PRODUCER)) {
ERROR("BMediaRoster::Connect: source node %ld is not a "
ERROR("BMediaRoster::Connect: source node %" B_PRId32 " is not a "
"B_BUFFER_PRODUCER\n", sourcenode.node);
return B_MEDIA_BAD_SOURCE;
}
if (!(destnode.kind & B_BUFFER_CONSUMER)) {
ERROR("BMediaRoster::Connect: destination node %ld is not a "
ERROR("BMediaRoster::Connect: destination node %" B_PRId32 " is not a "
"B_BUFFER_CONSUMER\n", destnode.node);
return B_MEDIA_BAD_DESTINATION;
}
@@ -907,7 +920,7 @@ BMediaRoster::Connect(const media_source& from, const media_destination& to,
sizeof(request1), &reply1, sizeof(reply1));
if (rv != B_OK) {
ERROR("BMediaRoster::Connect: aborted after "
"BBufferProducer::FormatProposal, status = %#lx\n",rv);
"BBufferProducer::FormatProposal, status = %#" B_PRIx32 "\n",rv);
return rv;
}
// reply1.format now contains the format proposed by the producer
@@ -925,7 +938,7 @@ BMediaRoster::Connect(const media_source& from, const media_destination& to,
sizeof(request2), &reply2, sizeof(reply2));
if (rv != B_OK) {
ERROR("BMediaRoster::Connect: aborted after "
"BBufferConsumer::AcceptFormat, status = %#lx\n",rv);
"BBufferConsumer::AcceptFormat, status = %#" B_PRIx32 "\n",rv);
return rv;
}
// reply2.format now contains the format accepted by the consumer
@@ -945,7 +958,7 @@ BMediaRoster::Connect(const media_source& from, const media_destination& to,
sizeof(request3), &reply3, sizeof(reply3));
if (rv != B_OK) {
ERROR("BMediaRoster::Connect: aborted after "
"BBufferProducer::PrepareToConnect, status = %#lx\n",rv);
"BBufferProducer::PrepareToConnect, status = %#" B_PRIx32 "\n", rv);
return rv;
}
// reply3.format is still our pretty media format
@@ -971,7 +984,8 @@ BMediaRoster::Connect(const media_source& from, const media_destination& to,
sizeof(request4), &reply4, sizeof(reply4));
if (con_status != B_OK) {
ERROR("BMediaRoster::Connect: aborting after "
"BBufferConsumer::Connected, status = %#lx\n",con_status);
"BBufferConsumer::Connected, status = %#" B_PRIx32 "\n",
con_status);
// we do NOT return here!
}
// con_status contains the status code to be supplied to
@@ -999,7 +1013,7 @@ BMediaRoster::Connect(const media_source& from, const media_destination& to,
}
if (rv != B_OK) {
ERROR("BMediaRoster::Connect: aborted after BBufferProducer::Connect()"
", status = %#lx\n",rv);
", status = %#" B_PRIx32 "\n", rv);
return rv;
}
// reply5.name contains the name assigned to the connection by the producer
@@ -1091,26 +1105,27 @@ BMediaRoster::Disconnect(media_node_id source_nodeid,
media_node destnode;
if (GetNodeFor(source_nodeid, &sourcenode) == B_OK) {
if (!(sourcenode.kind & B_BUFFER_PRODUCER)) {
ERROR("BMediaRoster::Disconnect: source_nodeid %ld is not a "
"B_BUFFER_PRODUCER\n", source_nodeid);
ERROR("BMediaRoster::Disconnect: source_nodeid %" B_PRId32
" is not a B_BUFFER_PRODUCER\n", source_nodeid);
}
if (MediaRosterEx(this)->GetAllOutputs(sourcenode , &outlist) == B_OK)
MediaRosterEx(this)->PublishOutputs(sourcenode , &outlist);
ReleaseNode(sourcenode);
} else {
ERROR("BMediaRoster::Disconnect: GetNodeFor source_nodeid %ld failed\n", source_nodeid);
ERROR("BMediaRoster::Disconnect: GetNodeFor source_nodeid %" B_PRId32
" failed\n", source_nodeid);
}
if (GetNodeFor(destination_nodeid, &destnode) == B_OK) {
if (!(destnode.kind & B_BUFFER_CONSUMER)) {
ERROR("BMediaRoster::Disconnect: destination_nodeid %ld is not a "
"B_BUFFER_CONSUMER\n", destination_nodeid);
ERROR("BMediaRoster::Disconnect: destination_nodeid %" B_PRId32
" is not a B_BUFFER_CONSUMER\n", destination_nodeid);
}
if (MediaRosterEx(this)->GetAllInputs(destnode , &inlist) == B_OK)
MediaRosterEx(this)->PublishInputs(destnode, &inlist);
ReleaseNode(destnode);
} else {
ERROR("BMediaRoster::Disconnect: GetNodeFor destination_nodeid %ld "
"failed\n", destination_nodeid);
ERROR("BMediaRoster::Disconnect: GetNodeFor destination_nodeid %"
B_PRId32 " failed\n", destination_nodeid);
}
// send a notification
@@ -1124,45 +1139,47 @@ status_t
BMediaRoster::Disconnect(const media_output& output, const media_input& input)
{
if (IS_INVALID_NODEID(output.node.node)) {
printf("BMediaRoster::Disconnect: output.node.node %ld invalid\n",
output.node.node);
printf("BMediaRoster::Disconnect: output.node.node %" B_PRId32
" invalid\n", output.node.node);
return B_MEDIA_BAD_SOURCE;
}
if (IS_INVALID_NODEID(input.node.node)) {
printf("BMediaRoster::Disconnect: input.node.node %ld invalid\n",
input.node.node);
printf("BMediaRoster::Disconnect: input.node.node %" B_PRId32
" invalid\n", input.node.node);
return B_MEDIA_BAD_DESTINATION;
}
if (!(output.node.kind & B_BUFFER_PRODUCER)) {
printf("BMediaRoster::Disconnect: output.node.kind 0x%lx is no "
"B_BUFFER_PRODUCER\n", output.node.kind);
printf("BMediaRoster::Disconnect: output.node.kind 0x%" B_PRIx32
" is no B_BUFFER_PRODUCER\n", output.node.kind);
return B_MEDIA_BAD_SOURCE;
}
if (!(input.node.kind & B_BUFFER_CONSUMER)) {
printf("BMediaRoster::Disconnect: input.node.kind 0x%lx is no "
"B_BUFFER_PRODUCER\n", input.node.kind);
printf("BMediaRoster::Disconnect: input.node.kind 0x%" B_PRIx32
" is no B_BUFFER_PRODUCER\n", input.node.kind);
return B_MEDIA_BAD_DESTINATION;
}
if (input.source.port != output.source.port) {
printf("BMediaRoster::Disconnect: input.source.port %ld doesn't match "
"output.source.port %ld\n", input.source.port, output.source.port);
printf("BMediaRoster::Disconnect: input.source.port %" B_PRId32
" doesn't match output.source.port %" B_PRId32 "\n",
input.source.port, output.source.port);
return B_MEDIA_BAD_SOURCE;
}
if (input.source.id != output.source.id) {
printf("BMediaRoster::Disconnect: input.source.id %ld doesn't match "
"output.source.id %ld\n", input.source.id, output.source.id);
printf("BMediaRoster::Disconnect: input.source.id %" B_PRId32
" doesn't match output.source.id %" B_PRId32 "\n", input.source.id,
output.source.id);
return B_MEDIA_BAD_SOURCE;
}
if (input.destination.port != output.destination.port) {
printf("BMediaRoster::Disconnect: input.destination.port %ld doesn't "
"match output.destination.port %ld\n", input.destination.port,
output.destination.port);
printf("BMediaRoster::Disconnect: input.destination.port %" B_PRId32
" doesn't match output.destination.port %" B_PRId32 "\n",
input.destination.port, output.destination.port);
return B_MEDIA_BAD_DESTINATION;
}
if (input.destination.id != output.destination.id) {
printf("BMediaRoster::Disconnect: input.destination.id %ld doesn't "
"match output.destination.id %ld\n", input.destination.id,
output.destination.id);
printf("BMediaRoster::Disconnect: input.destination.id %" B_PRId32
" doesn't match output.destination.id %" B_PRId32 "\n",
input.destination.id, output.destination.id);
return B_MEDIA_BAD_DESTINATION;
}
@@ -1178,8 +1195,8 @@ BMediaRoster::StartNode(const media_node& node, bigtime_t atPerformanceTime)
if (node.node <= 0)
return B_MEDIA_BAD_NODE;
TRACE("BMediaRoster::StartNode, node %ld, at perf %Ld\n", node.node,
atPerformanceTime);
TRACE("BMediaRoster::StartNode, node %" B_PRId32 ", at perf %" B_PRId64
"\n", node.node, atPerformanceTime);
node_start_command command;
command.performance_time = atPerformanceTime;
@@ -1196,8 +1213,8 @@ BMediaRoster::StopNode(const media_node& node, bigtime_t atPerformanceTime,
if (IS_INVALID_NODE(node))
return B_MEDIA_BAD_NODE;
TRACE("BMediaRoster::StopNode, node %ld, at perf %Ld %s\n", node.node,
atPerformanceTime, immediate ? "NOW" : "");
TRACE("BMediaRoster::StopNode, node %" B_PRId32 ", at perf %" B_PRId64
" %s\n", node.node, atPerformanceTime, immediate ? "NOW" : "");
node_stop_command command;
command.performance_time = atPerformanceTime;
@@ -1215,8 +1232,8 @@ BMediaRoster::SeekNode(const media_node& node, bigtime_t toMediaTime,
if (IS_INVALID_NODE(node))
return B_MEDIA_BAD_NODE;
TRACE("BMediaRoster::SeekNode, node %ld, at perf %Ld, to perf %Ld\n",
node.node, atPerformanceTime, toMediaTime);
TRACE("BMediaRoster::SeekNode, node %" B_PRId32 ", at perf %" B_PRId64
", to perf %" B_PRId64 "\n", node.node, atPerformanceTime, toMediaTime);
node_seek_command command;
command.media_time = toMediaTime;
@@ -1232,26 +1249,27 @@ BMediaRoster::StartTimeSource(const media_node& node, bigtime_t atRealTime)
CALLED();
if (IS_SYSTEM_TIMESOURCE(node)) {
// TODO: debug this
//ERROR("BMediaRoster::StartTimeSource node %ld is system timesource\n", node.node);
//ERROR("BMediaRoster::StartTimeSource node %" B_PRId32 " is system timesource\n", node.node);
return B_OK;
}
// if (IS_SHADOW_TIMESOURCE(node)) {
// // TODO: debug this
// ERROR("BMediaRoster::StartTimeSource node %ld is shadow timesource\n", node.node);
// ERROR("BMediaRoster::StartTimeSource node %" B_PRId32 " is shadow timesource\n", node.node);
// return B_OK;
// }
if (IS_INVALID_NODE(node)) {
ERROR("BMediaRoster::StartTimeSource node %ld invalid\n", node.node);
return B_MEDIA_BAD_NODE;
}
if ((node.kind & B_TIME_SOURCE) == 0) {
ERROR("BMediaRoster::StartTimeSource node %ld is no timesource\n",
ERROR("BMediaRoster::StartTimeSource node %" B_PRId32 " invalid\n",
node.node);
return B_MEDIA_BAD_NODE;
}
if ((node.kind & B_TIME_SOURCE) == 0) {
ERROR("BMediaRoster::StartTimeSource node %" B_PRId32
" is no timesource\n", node.node);
return B_MEDIA_BAD_NODE;
}
TRACE("BMediaRoster::StartTimeSource, node %ld, at real %Ld\n", node.node,
atRealTime);
TRACE("BMediaRoster::StartTimeSource, node %" B_PRId32 ", at real %"
B_PRId64 "\n", node.node, atRealTime);
BTimeSource::time_source_op_info msg;
msg.op = BTimeSource::B_TIMESOURCE_START;
@@ -1277,17 +1295,18 @@ BMediaRoster::StopTimeSource(const media_node& node, bigtime_t atRealTime,
// return B_OK;
// }
if (IS_INVALID_NODE(node)) {
ERROR("BMediaRoster::StopTimeSource node %ld invalid\n", node.node);
return B_MEDIA_BAD_NODE;
}
if ((node.kind & B_TIME_SOURCE) == 0) {
ERROR("BMediaRoster::StopTimeSource node %ld is no timesource\n",
ERROR("BMediaRoster::StopTimeSource node %" B_PRId32 " invalid\n",
node.node);
return B_MEDIA_BAD_NODE;
}
if ((node.kind & B_TIME_SOURCE) == 0) {
ERROR("BMediaRoster::StopTimeSource node %" B_PRId32 " is no "
"timesource\n", node.node);
return B_MEDIA_BAD_NODE;
}
TRACE("BMediaRoster::StopTimeSource, node %ld, at real %Ld %s\n",
node.node, atRealTime, immediate ? "NOW" : "");
TRACE("BMediaRoster::StopTimeSource, node %" B_PRId32 ", at real %" B_PRId64
" %s\n", node.node, atRealTime, immediate ? "NOW" : "");
BTimeSource::time_source_op_info msg;
msg.op = immediate ? BTimeSource::B_TIMESOURCE_STOP_IMMEDIATELY
@@ -1316,17 +1335,18 @@ BMediaRoster::SeekTimeSource(const media_node& node,
// return B_OK;
// }
if (IS_INVALID_NODE(node)) {
ERROR("BMediaRoster::SeekTimeSource node %ld invalid\n", node.node);
return B_MEDIA_BAD_NODE;
}
if ((node.kind & B_TIME_SOURCE) == 0) {
ERROR("BMediaRoster::SeekTimeSource node %ld is no timesource\n",
ERROR("BMediaRoster::SeekTimeSource node %" B_PRId32 " invalid\n",
node.node);
return B_MEDIA_BAD_NODE;
}
if ((node.kind & B_TIME_SOURCE) == 0) {
ERROR("BMediaRoster::SeekTimeSource node %" B_PRId32
" is no timesource\n", node.node);
return B_MEDIA_BAD_NODE;
}
TRACE("BMediaRoster::SeekTimeSource, node %ld, at real %Ld, to perf %Ld\n",
node.node, atRealTime, toPerformanceTime);
TRACE("BMediaRoster::SeekTimeSource, node %" B_PRId32 ", at real %" B_PRId64
", to perf %" B_PRId64 "\n", node.node, atRealTime, toPerformanceTime);
BTimeSource::time_source_op_info msg;
msg.op = BTimeSource::B_TIMESOURCE_SEEK;
@@ -1349,7 +1369,8 @@ BMediaRoster::SyncToNode(const media_node& node, bigtime_t atTime,
status_t
BMediaRoster::SetRunModeNode(const media_node& node, BMediaNode::run_mode mode)
{
TRACE("BMediaRoster::SetRunModeNode, node %ld, mode %d\n", node.node, mode);
TRACE("BMediaRoster::SetRunModeNode, node %" B_PRId32 ", mode %d\n",
node.node, mode);
if (IS_INVALID_NODE(node))
return B_MEDIA_BAD_NODE;
@@ -1385,8 +1406,8 @@ status_t
BMediaRoster::SetProducerRunModeDelay(const media_node& node,
bigtime_t delay, BMediaNode::run_mode mode)
{
TRACE("BMediaRoster::SetProducerRunModeDelay, node %ld, delay %Ld, "
"mode %d\n", node.node, delay, mode);
TRACE("BMediaRoster::SetProducerRunModeDelay, node %" B_PRId32 ", delay %"
B_PRId64 ", mode %d\n", node.node, delay, mode);
if (IS_INVALID_NODE(node))
return B_MEDIA_BAD_NODE;
if ((node.kind & B_BUFFER_PRODUCER) == 0)
@@ -1522,13 +1543,13 @@ BMediaRoster::GetFreeInputsFor(const media_node& node,
{
CALLED();
if (IS_INVALID_NODE(node)) {
ERROR("BMediaRoster::GetFreeInputsFor: node %ld, port %ld invalid\n",
node.node, node.port);
ERROR("BMediaRoster::GetFreeInputsFor: node %" B_PRId32 ", port %"
B_PRId32 " invalid\n", node.node, node.port);
return B_MEDIA_BAD_NODE;
}
if ((node.kind & B_BUFFER_CONSUMER) == 0) {
ERROR("BMediaRoster::GetFreeInputsFor: node %ld, port %ld is not a "
"consumer\n", node.node, node.port);
ERROR("BMediaRoster::GetFreeInputsFor: node %" B_PRId32 ", port %"
B_PRId32 " is not a consumer\n", node.node, node.port);
return B_MEDIA_BAD_NODE;
}
if (out_free_inputs == NULL || out_total_count == NULL)
@@ -1544,8 +1565,9 @@ BMediaRoster::GetFreeInputsFor(const media_node& node,
if (B_OK != rv)
return rv;
PRINT(4, "BMediaRoster::GetFreeInputsFor node %ld, max %ld, filter-type "
"%ld\n", node.node, buf_num_inputs, filter_type);
PRINT(4, "BMediaRoster::GetFreeInputsFor node %" B_PRId32 ", max %" B_PRId32
", filter-type %" B_PRId32 "\n", node.node, buf_num_inputs,
filter_type);
int32 i;
for (i = 0, list.Rewind(); list.GetNext(&input);) {
@@ -1596,8 +1618,8 @@ BMediaRoster::GetConnectedInputsFor(const media_node& node,
if (B_OK != rv)
return rv;
PRINT(4, "BMediaRoster::GetConnectedInputsFor node %ld, max %ld\n",
node.node, buf_num_inputs);
PRINT(4, "BMediaRoster::GetConnectedInputsFor node %" B_PRId32 ", max %"
B_PRId32 "\n", node.node, buf_num_inputs);
int32 i;
for (i = 0, list.Rewind(); list.GetNext(&input);) {
@@ -1639,8 +1661,8 @@ BMediaRoster::GetAllInputsFor(const media_node& node, media_input* out_inputs,
if (B_OK != rv)
return rv;
PRINT(4, "BMediaRoster::GetAllInputsFor node %ld, max %ld\n", node.node,
buf_num_inputs);
PRINT(4, "BMediaRoster::GetAllInputsFor node %" B_PRId32 ", max %" B_PRId32
"\n", node.node, buf_num_inputs);
int32 i;
for (i = 0, list.Rewind(); list.GetNext(&input); i++) {
@@ -1680,8 +1702,9 @@ BMediaRoster::GetFreeOutputsFor(const media_node& node,
if (B_OK != rv)
return rv;
PRINT(4, "BMediaRoster::GetFreeOutputsFor node %ld, max %ld, filter-type "
"%ld\n", node.node, buf_num_outputs, filter_type);
PRINT(4, "BMediaRoster::GetFreeOutputsFor node %" B_PRId32 ", max %"
B_PRId32 ", filter-type %" B_PRId32 "\n", node.node, buf_num_outputs,
filter_type);
int32 i;
for (i = 0, list.Rewind(); list.GetNext(&output);) {
@@ -1732,8 +1755,8 @@ BMediaRoster::GetConnectedOutputsFor(const media_node& node,
if (B_OK != rv)
return rv;
PRINT(4, "BMediaRoster::GetConnectedOutputsFor node %ld, max %ld\n",
node.node, buf_num_outputs);
PRINT(4, "BMediaRoster::GetConnectedOutputsFor node %" B_PRId32 ", max %"
B_PRId32 "\n", node.node, buf_num_outputs);
int32 i;
for (i = 0, list.Rewind(); list.GetNext(&output);) {
@@ -1777,8 +1800,8 @@ BMediaRoster::GetAllOutputsFor(const media_node& node,
if (B_OK != rv)
return rv;
PRINT(4, "BMediaRoster::GetAllOutputsFor node %ld, max %ld\n", node.node,
buf_num_outputs);
PRINT(4, "BMediaRoster::GetAllOutputsFor node %" B_PRId32 ", max %" B_PRId32
"\n", node.node, buf_num_outputs);
int32 i;
for (i = 0, list.Rewind(); list.GetNext(&output); i++) {
@@ -1935,8 +1958,8 @@ BMediaRosterEx::RegisterNode(BMediaNode* node, media_addon_id addOnID,
request.team = BPrivate::current_team();
TRACE("BMediaRoster::RegisterNode: sending SERVER_REGISTER_NODE: port "
"%ld, kinds 0x%Lx, team %ld, name '%s'\n", request.port, request.kinds,
request.team, request.name);
"%" B_PRId32 ", kinds 0x%" B_PRIx64 ", team %" B_PRId32 ", name '%s'\n",
request.port, request.kinds, request.team, request.name);
status_t status = QueryServer(SERVER_REGISTER_NODE, &request,
sizeof(request), &reply, sizeof(reply));
@@ -2059,8 +2082,9 @@ BMediaRoster::UnregisterNode(BMediaNode* node)
status_t status = QueryServer(SERVER_UNREGISTER_NODE, &request,
sizeof(request), &reply, sizeof(reply));
if (status != B_OK) {
ERROR("BMediaRoster::UnregisterNode: failed to unregister node id %ld, "
"name '%s': %s\n", node->ID(), node->Name(), strerror(status));
ERROR("BMediaRoster::UnregisterNode: failed to unregister node id %"
B_PRId32 ", name '%s': %s\n", node->ID(), node->Name(),
strerror(status));
return status;
}
@@ -2135,16 +2159,16 @@ BMediaRoster::SetTimeSourceFor(media_node_id node, media_node_id time_source)
media_node clone;
status_t rv, result;
TRACE("BMediaRoster::SetTimeSourceFor: node %ld will be assigned time "
"source %ld\n", node, time_source);
TRACE("BMediaRoster::SetTimeSourceFor: node %ld time source %ld enter\n",
node, time_source);
TRACE("BMediaRoster::SetTimeSourceFor: node %" B_PRId32 " will be assigned "
"time source %" B_PRId32 "\n", node, time_source);
TRACE("BMediaRoster::SetTimeSourceFor: node %" B_PRId32 " time source %"
B_PRId32 " enter\n", node, time_source);
// we need to get a clone of the node to have a port id
rv = GetNodeFor(node, &clone);
if (rv != B_OK) {
ERROR("BMediaRoster::SetTimeSourceFor, GetNodeFor failed, node id "
"%ld\n", node);
ERROR("BMediaRoster::SetTimeSourceFor, GetNodeFor failed, node id %"
B_PRId32 "\n", node);
return B_ERROR;
}
@@ -2156,20 +2180,20 @@ BMediaRoster::SetTimeSourceFor(media_node_id node, media_node_id time_source)
rv = SendToPort(clone.port, NODE_SET_TIMESOURCE, &cmd, sizeof(cmd));
if (rv != B_OK) {
ERROR("BMediaRoster::SetTimeSourceFor, sending NODE_SET_TIMESOURCE "
"failed, node id %ld\n", node);
"failed, node id %" B_PRId32 "\n", node);
result = B_ERROR;
}
// we release the clone
rv = ReleaseNode(clone);
if (rv != B_OK) {
ERROR("BMediaRoster::SetTimeSourceFor, ReleaseNode failed, node id "
"%ld\n", node);
ERROR("BMediaRoster::SetTimeSourceFor, ReleaseNode failed, node id %"
B_PRId32 "\n", node);
result = B_ERROR;
}
TRACE("BMediaRoster::SetTimeSourceFor: node %ld time source %ld leave\n",
node, time_source);
TRACE("BMediaRoster::SetTimeSourceFor: node %" B_PRId32 " time source %"
B_PRId32 " leave\n", node, time_source);
return result;
}
@@ -2202,7 +2226,7 @@ BMediaRoster::GetParameterWebFor(const media_node& node, BParameterWeb** _web)
B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
if (area < B_OK) {
ERROR("BMediaRoster::GetParameterWebFor couldn't create area of "
"size %ld\n", size);
"size %" B_PRId32 "\n", size);
return B_ERROR;
}
request.max_size = size;
@@ -2218,8 +2242,8 @@ BMediaRoster::GetParameterWebFor(const media_node& node, BParameterWeb** _web)
if (reply.size == 0) {
// no parameter web available
// TODO: should we return an error?
ERROR("BMediaRoster::GetParameterWebFor node %ld has no parameter "
"web\n", node.node);
ERROR("BMediaRoster::GetParameterWebFor node %" B_PRId32
" has no parameter web\n", node.node);
*_web = new (std::nothrow) BParameterWeb();
delete_area(area);
return *_web != NULL ? B_OK : B_NO_MEMORY;
@@ -2230,10 +2254,11 @@ BMediaRoster::GetParameterWebFor(const media_node& node, BParameterWeb** _web)
if (*_web == NULL)
rv = B_NO_MEMORY;
else {
printf("BMediaRoster::GetParameterWebFor Unflattening %ld "
"bytes, 0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx\n",
reply.size, ((uint32*)data)[0], ((uint32*)data)[1],
((uint32*)data)[2], ((uint32*)data)[3]);
printf("BMediaRoster::GetParameterWebFor Unflattening %"
B_PRId32 " bytes, %#" B_PRIx32 ", %#" B_PRIx32 ", %#"
B_PRIx32 ", %#" B_PRIx32 "\n", reply.size,
((uint32*)data)[0], ((uint32*)data)[1], ((uint32*)data)[2],
((uint32*)data)[3]);
rv = (*_web)->Unflatten(reply.code, data, reply.size);
}
@@ -2250,8 +2275,8 @@ BMediaRoster::GetParameterWebFor(const media_node& node, BParameterWeb** _web)
// parameter web data was too large
// loop and try a larger size
}
ERROR("BMediaRoster::GetParameterWebFor node %ld has no parameter web "
"larger than %ld\n", node.node, size);
ERROR("BMediaRoster::GetParameterWebFor node %" B_PRId32 " has no "
"parameter web larger than %" B_PRId32 "\n", node.node, size);
return B_ERROR;
}
@@ -2359,8 +2384,8 @@ BMediaRosterEx::InstantiateDormantNode(media_addon_id addonID, int32 flavorID,
// media_addon_server context) the team-id of the team that
// requested the instantiation.
TRACE("BMediaRosterEx::InstantiateDormantNode: addonID %ld, flavorID "
"%ld\n", addonID, flavorID);
TRACE("BMediaRosterEx::InstantiateDormantNode: addonID %" B_PRId32
", flavorID %" B_PRId32 "\n", addonID, flavorID);
// Get flavor_info from the server
dormant_flavor_info info;
@@ -2368,8 +2393,8 @@ BMediaRosterEx::InstantiateDormantNode(media_addon_id addonID, int32 flavorID,
rv = GetDormantFlavorInfo(addonID, flavorID, &info);
if (rv != B_OK) {
ERROR("BMediaRosterEx::InstantiateDormantNode error: failed to get "
"dormant_flavor_info for addon-id %ld, flavor-id %ld\n", addonID,
flavorID);
"dormant_flavor_info for addon-id %" B_PRId32 ", flavor-id %"
B_PRId32 "\n", addonID, flavorID);
return B_ERROR;
}
@@ -2388,7 +2413,8 @@ BMediaRosterEx::InstantiateDormantNode(media_addon_id addonID, int32 flavorID,
rv = IncrementAddonFlavorInstancesCount(addonID, flavorID);
if (rv != B_OK) {
ERROR("BMediaRosterEx::InstantiateDormantNode error: can't create "
"more nodes for addon-id %ld, flavor-id %ld\n", addonID, flavorID);
"more nodes for addon-id %" B_PRId32 ", flavor-id %" B_PRId32 "\n",
addonID, flavorID);
// Put the addon back into the pool
gDormantNodeManager->PutAddOn(addonID);
return B_ERROR;
@@ -2398,8 +2424,8 @@ BMediaRosterEx::InstantiateDormantNode(media_addon_id addonID, int32 flavorID,
rv = LoadNodeConfiguration(addonID, flavorID, &config);
if (rv != B_OK) {
ERROR("BMediaRosterEx::InstantiateDormantNode: couldn't load "
"configuration for addon-id %ld, flavor-id %ld\n", addonID,
flavorID);
"configuration for addon-id %" B_PRId32 ", flavor-id %" B_PRId32
"\n", addonID, flavorID);
// do not return, this is a minor problem, not a reason to fail
}
@@ -2441,13 +2467,15 @@ BMediaRosterEx::InstantiateDormantNode(media_addon_id addonID, int32 flavorID,
if (creator != -1) {
// send a message to the server to assign team "creator" as creator
// of node "node->ID()"
printf("!!! BMediaRosterEx::InstantiateDormantNode assigning team "
"%ld as creator of node %ld\n", creator, node->ID());
printf("!!! BMediaRosterEx::InstantiateDormantNode assigning team %"
B_PRId32 " as creator of node %" B_PRId32 "\n", creator,
node->ID());
rv = MediaRosterEx(this)->SetNodeCreator(node->ID(), creator);
if (rv != B_OK) {
ERROR("BMediaRosterEx::InstantiateDormantNode failed to assign "
"team %ld as creator of node %ld\n", creator, node->ID());
"team %" B_PRId32 " as creator of node %" B_PRId32 "\n",
creator, node->ID());
// do not return, this is a minor problem, not a reason to fail
}
}
@@ -2458,9 +2486,10 @@ BMediaRosterEx::InstantiateDormantNode(media_addon_id addonID, int32 flavorID,
*_node = node->Node();
TRACE("BMediaRosterEx::InstantiateDormantNode: addon-id %ld, flavor_id "
"%ld instanciated as node %ld, port %ld in team %ld\n", addonID,
flavorID, _node->node, _node->port, BPrivate::current_team());
TRACE("BMediaRosterEx::InstantiateDormantNode: addon-id %" B_PRId32
", flavor_id %" B_PRId32 " instanciated as node %" B_PRId32 ", port %"
B_PRId32 " in team %" B_PRId32 "\n", addonID, flavorID, _node->node,
_node->port, BPrivate::current_team());
return B_OK;
}
@@ -2474,13 +2503,14 @@ BMediaRoster::InstantiateDormantNode(const dormant_node_info& info,
if (_node == NULL)
return B_BAD_VALUE;
if (info.addon <= B_OK) {
ERROR("BMediaRoster::InstantiateDormantNode error: addon-id %ld "
"invalid.\n", info.addon);
ERROR("BMediaRoster::InstantiateDormantNode error: addon-id %" B_PRId32
" invalid.\n", info.addon);
return B_BAD_VALUE;
}
printf("BMediaRoster::InstantiateDormantNode: addon-id %ld, flavor_id "
"%ld, flags 0x%lX\n", info.addon, info.flavor_id, flags);
printf("BMediaRoster::InstantiateDormantNode: addon-id %" B_PRId32
", flavor_id %" B_PRId32 ", flags 0x%" B_PRIx32 "\n", info.addon,
info.flavor_id, flags);
// Get flavor_info from the server
// TODO: this is a little overhead, as we get the full blown
@@ -2492,8 +2522,8 @@ BMediaRoster::InstantiateDormantNode(const dormant_node_info& info,
&flavorInfo);
if (rv != B_OK) {
ERROR("BMediaRoster::InstantiateDormantNode: failed to get "
"dormant_flavor_info for addon-id %ld, flavor-id %ld\n",
info.addon, info.flavor_id);
"dormant_flavor_info for addon-id %" B_PRId32 ", flavor-id %"
B_PRId32 "\n", info.addon, info.flavor_id);
return B_NAME_NOT_FOUND;
}
@@ -2501,9 +2531,10 @@ BMediaRoster::InstantiateDormantNode(const dormant_node_info& info,
#if DEBUG
printf("BMediaRoster::InstantiateDormantNode: name \"%s\", info \"%s\", "
"flavor_flags 0x%lX, internal_id %ld, possible_count %ld\n",
flavorInfo.name, flavorInfo.info, flavorInfo.flavor_flags,
flavorInfo.internal_id, flavorInfo.possible_count);
"flavor_flags 0x%" B_PRIx32 ", internal_id %" B_PRId32
", possible_count %" B_PRId32 "\n", flavorInfo.name, flavorInfo.info,
flavorInfo.flavor_flags, flavorInfo.internal_id,
flavorInfo.possible_count);
if ((flags & B_FLAVOR_IS_LOCAL) != 0) {
printf("BMediaRoster::InstantiateDormantNode: caller requested "
@@ -2702,8 +2733,8 @@ BMediaRoster::GetInitialLatencyFor(const media_node& producer,
if (_flags != NULL)
*_flags = reply.flags;
TRACE("BMediaRoster::GetInitialLatencyFor producer %ld has maximum "
"initial latency %Ld\n", producer.node, *_latency);
TRACE("BMediaRoster::GetInitialLatencyFor producer %" B_PRId32 " has "
"maximum initial latency %" B_PRId64 "\n", producer.node, *_latency);
return B_OK;
}
@@ -2730,8 +2761,8 @@ BMediaRoster::GetStartLatencyFor(const media_node& timeSource,
*_latency = reply.start_latency;
TRACE("BMediaRoster::GetStartLatencyFor timesource %ld has maximum "
"initial latency %Ld\n", timeSource.node, *_latency);
TRACE("BMediaRoster::GetStartLatencyFor timesource %" B_PRId32 " has "
"maximum initial latency %" B_PRId64 "\n", timeSource.node, *_latency);
return B_OK;
}
@@ -2838,7 +2869,8 @@ BMediaRoster::SniffRef(const entry_ref& file, uint64 requireNodeKinds,
{
CALLED();
TRACE("BMediaRoster::SniffRef looking for a node to handle %s : %Ld\n",file.name, requireNodeKinds);
TRACE("BMediaRoster::SniffRef looking for a node to handle %s: 0x%" B_PRIx64
"\n", file.name, requireNodeKinds);
if (_node == NULL)
return B_BAD_VALUE;
@@ -2873,8 +2905,10 @@ BMediaRoster::SniffRef(const entry_ref& file, uint64 requireNodeKinds,
if (highestCapability != -1) {
*_node = nodes[highestCapability];
TRACE("BMediaRoster::SniffRef: found a node %s addon-id %ld, flavor_id %ld\n",
nodes[highestCapability].name, nodes[highestCapability].addon, nodes[highestCapability].flavor_id);
TRACE("BMediaRoster::SniffRef: found a node %s addon-id %" B_PRId32
", flavor_id %" B_PRId32 "\n",
nodes[highestCapability].name, nodes[highestCapability].addon,
nodes[highestCapability].flavor_id);
if (mimeType != NULL) {
//*mimeType = aMimeType; -- need a copy constructor
@@ -3013,7 +3047,7 @@ BMediaRoster::NodeIDFor(port_id port)
rv = QueryServer(SERVER_NODE_ID_FOR, &request, sizeof(request), &reply,
sizeof(reply));
if (rv != B_OK) {
ERROR("BMediaRoster::NodeIDFor: failed (error %#lx)\n", rv);
ERROR("BMediaRoster::NodeIDFor: failed (error %#" B_PRIx32 ")\n", rv);
return -1;
}
@@ -3101,8 +3135,8 @@ BMediaRoster::AudioBufferSizeFor(int32 channelCount, uint32 sampleFormat,
bufferSize = (sampleFormat & 0xf) * channelCount
* (ssize_t)((frameRate * bufferDuration) / 1000000.0);
printf("Suggested buffer duration %Ld, size %ld\n", bufferDuration,
bufferSize);
printf("Suggested buffer duration %" B_PRId64 ", size %" B_PRIdSSIZE "\n",
bufferDuration, bufferSize);
return bufferSize;
}
@@ -3148,10 +3182,12 @@ BMediaRoster::MessageReceived(BMessage* message)
BMediaNode *node;
message->FindPointer("node", reinterpret_cast<void **>(&node));
TRACE("BMediaRoster::MessageReceived NODE_FINAL_RELEASE saving node %ld configuration\n", node->ID());
TRACE("BMediaRoster::MessageReceived NODE_FINAL_RELEASE saving "
"node %" B_PRId32 " configuration\n", node->ID());
MediaRosterEx(BMediaRoster::Roster())->SaveNodeConfiguration(node);
TRACE("BMediaRoster::MessageReceived NODE_FINAL_RELEASE releasing node %ld\n", node->ID());
TRACE("BMediaRoster::MessageReceived NODE_FINAL_RELEASE releasing "
"node %" B_PRId32 "\n", node->ID());
node->DeleteHook(node); // we don't call Release(), see above!
return;
}
+2 -2
View File
@@ -340,8 +340,8 @@ BMediaTrack::ReadFrames(void* buffer, int64* _frameCount,
//fflush(stdout);
//}
} else {
ERROR("BMediaTrack::ReadFrames: decoder returned error 0x%08lx (%s)\n",
result, strerror(result));
ERROR("BMediaTrack::ReadFrames: decoder returned error %#" B_PRIx32
" (%s)\n", result, strerror(result));
*_frameCount = 0;
}
+2 -2
View File
@@ -125,7 +125,7 @@ MediaWriter::CreateEncoder(Encoder** _encoder,
if (!fStreamInfos.Insert(info)) {
gPluginManager.DestroyEncoder(encoder);
ERROR("MediaWriter::CreateEncoder can't create StreamInfo "
"for stream %ld\n", streamIndex);
"for stream %" B_PRId32 "\n", streamIndex);
return B_NO_MEMORY;
}
@@ -134,7 +134,7 @@ MediaWriter::CreateEncoder(Encoder** _encoder,
if (chunkWriter == NULL) {
gPluginManager.DestroyEncoder(encoder);
ERROR("MediaWriter::CreateEncoder can't create ChunkWriter "
"for stream %ld\n", streamIndex);
"for stream %" B_PRId32 "\n", streamIndex);
return B_NO_MEMORY;
}
+40 -12
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009, Haiku. All Rights Reserved.
* Copyright 2002-2012, Haiku. All Rights Reserved.
* This file may be used under the terms of the MIT License.
*
* Author: Zousar Shaker
@@ -7,11 +7,13 @@
* Marcus Overhagen
*/
/*! Implements the following classes:
BParameterWeb, BParameterGroup, BParameter, BNullParameter,
BContinuousParameter, BDiscreteParameter
*/
#include <ParameterWeb.h>
#include <new>
@@ -281,6 +283,18 @@ swap32(Type value, bool doSwap)
}
template<class Type> Type
swap64(Type value, bool doSwap)
{
STATIC_ASSERT(sizeof(Type) == 8);
if (doSwap)
return (Type)B_SWAP_INT64((int64)value);
return value;
}
template<class Type> Type
read_from_buffer_swap32(const void **_buffer, bool doSwap)
{
@@ -288,6 +302,19 @@ read_from_buffer_swap32(const void **_buffer, bool doSwap)
}
template<class Type> Type
read_pointer_from_buffer_swap(const void **_buffer, bool doSwap)
{
#if B_HAIKU_32_BIT
return swap32<Type>(read_from_buffer<Type>(_buffer), doSwap);
#elif B_HAIKU_64_BIT
return swap64<Type>(read_from_buffer<Type>(_buffer), doSwap);
#else
# error Interesting
#endif
}
static inline ssize_t
size_left(ssize_t size, const void *bufferStart, const void *buffer)
{
@@ -568,8 +595,8 @@ BParameterWeb::Unflatten(type_code code, const void* buffer, ssize_t size)
// information - but it doesn't seem to have another purpose
int32 version = read_from_buffer_swap32<int32>(&buffer, isSwapped);
if (version != kCurrentParameterWebVersion) {
ERROR("BParameterWeb::Unflatten(): wrong version %ld (%lx)?!\n",
version, version);
ERROR("BParameterWeb::Unflatten(): wrong version %" B_PRId32 " (%"
B_PRIx32 ")?!\n", version, version);
return B_ERROR;
}
@@ -1052,8 +1079,8 @@ BParameterGroup::Unflatten(type_code code, const void* buffer, ssize_t size)
if (size_left(size, bufferStart, buffer) < 12)
return B_BAD_VALUE;
BParameter* oldPointer = read_from_buffer_swap32<BParameter*>(&buffer,
isSwapped);
BParameter* oldPointer = read_pointer_from_buffer_swap<BParameter*>(
&buffer, isSwapped);
BParameter::media_parameter_type mediaType
= read_from_buffer_swap32<BParameter::media_parameter_type>(&buffer,
isSwapped);
@@ -1101,8 +1128,8 @@ BParameterGroup::Unflatten(type_code code, const void* buffer, ssize_t size)
if (size_left(size, bufferStart, buffer) < 12)
return B_BAD_VALUE;
BParameterGroup* oldPointer
= read_from_buffer_swap32<BParameterGroup*>(&buffer, isSwapped);
BParameterGroup* oldPointer = read_pointer_from_buffer_swap<
BParameterGroup*>(&buffer, isSwapped);
type_code type = read_from_buffer_swap32<type_code>(&buffer, isSwapped);
ssize_t groupSize
@@ -1161,7 +1188,8 @@ BParameterGroup::MakeControl(int32 type)
return new BTextParameter(-1, B_MEDIA_NO_TYPE, NULL, NULL, NULL, 0);
default:
ERROR("BParameterGroup::MakeControl unknown type %ld\n", type);
ERROR("BParameterGroup::MakeControl unknown type %" B_PRId32 "\n",
type);
return NULL;
}
}
@@ -1656,8 +1684,8 @@ BParameter::Unflatten(type_code code, const void* buffer, ssize_t size)
fInputs->MakeEmpty();
for (int32 i = 0; i < count; i++) {
fInputs->AddItem(read_from_buffer_swap32<BParameter * const>(&buffer,
fSwapDetected));
fInputs->AddItem(read_pointer_from_buffer_swap<BParameter * const>(
&buffer, fSwapDetected));
}
// read the list of outputs
@@ -1666,8 +1694,8 @@ BParameter::Unflatten(type_code code, const void* buffer, ssize_t size)
fOutputs->MakeEmpty();
for (int32 i = 0; i < count; i++) {
fOutputs->AddItem(read_from_buffer_swap32<BParameter * const>(&buffer,
fSwapDetected));
fOutputs->AddItem(read_pointer_from_buffer_swap<BParameter * const>(
&buffer, fSwapDetected));
}
fMediaType = read_from_buffer_swap32<media_type>(&buffer, fSwapDetected);
+7 -7
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2009, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2009-2012, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2002, Marcus Overhagen. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
@@ -80,7 +80,7 @@ SharedBufferList::Get()
sArea = clone_area("shared buffer list clone", (void**)&sList,
B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA, areaReply.area);
if (sArea < 0) {
ERROR("SharedBufferList::Get() clone area %ld: %s\n",
ERROR("SharedBufferList::Get() clone area %" B_PRId32 ": %s\n",
areaReply.area, strerror(sArea));
return NULL;
}
@@ -303,8 +303,8 @@ SharedBufferList::RecycleBuffer(BBuffer* buffer)
if (fInfos[i].id == id) {
reclaimedCount++;
if (fInfos[i].reclaimed) {
ERROR("SharedBufferList::RecycleBuffer, BBuffer %p, id = %ld "
"already reclaimed\n", buffer, id);
ERROR("SharedBufferList::RecycleBuffer, BBuffer %p, id = %"
B_PRId32 " already reclaimed\n", buffer, id);
DEBUG_ONLY(debugger("buffer already reclaimed"));
continue;
}
@@ -317,8 +317,8 @@ SharedBufferList::RecycleBuffer(BBuffer* buffer)
return B_ERROR;
if (reclaimedCount == 0) {
ERROR("shared_buffer_list::RecycleBuffer, BBuffer %p, id = %ld NOT "
"reclaimed\n", buffer, id);
ERROR("shared_buffer_list::RecycleBuffer, BBuffer %p, id = %" B_PRId32
" NOT reclaimed\n", buffer, id);
return B_ERROR;
}
@@ -397,7 +397,7 @@ SharedBufferList::_RequestBufferInOtherGroups(sem_id groupReclaimSem,
if (fInfos[i].reclaimed == false) {
ERROR("SharedBufferList:: RequestBufferInOtherGroups BBuffer "
"%p, id = %ld not reclaimed while requesting\n",
"%p, id = %" B_PRId32 " not reclaimed while requesting\n",
fInfos[i].buffer, id);
continue;
}

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