First pass at building for Haiku.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23426 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+4
-6
@@ -8,16 +8,15 @@
|
|||||||
/* returns true if == */
|
/* returns true if == */
|
||||||
bool CompareMessages(BMessage &a, BMessage &b)
|
bool CompareMessages(BMessage &a, BMessage &b)
|
||||||
{
|
{
|
||||||
void *cookie = NULL;
|
char *name;
|
||||||
const char *name;
|
|
||||||
type_code code;
|
type_code code;
|
||||||
int32 count, i;
|
int32 count, index, i;
|
||||||
const void *adata, *bdata;
|
const void *adata, *bdata;
|
||||||
ssize_t asize, bsize;
|
ssize_t asize, bsize;
|
||||||
|
|
||||||
if (a.what != b.what)
|
if (a.what != b.what)
|
||||||
return false;
|
return false;
|
||||||
while (a.GetNextName(&cookie, &name, &code, &count) == B_OK) {
|
for (index = 0; a.GetInfo(B_ANY_TYPE, index, &name, &code, &count) == B_OK; i++) {
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
if (a.FindData(name, code, i, &adata, &asize) != B_OK)
|
if (a.FindData(name, code, i, &adata, &asize) != B_OK)
|
||||||
return false;
|
return false;
|
||||||
@@ -29,9 +28,8 @@ bool CompareMessages(BMessage &a, BMessage &b)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cookie = NULL;
|
|
||||||
/* cross compare */
|
/* cross compare */
|
||||||
while (b.GetNextName(&cookie, &name, &code, &count) == B_OK) {
|
for (index = 0; b.GetInfo(B_ANY_TYPE, index, &name, &code, &count) == B_OK; i++) {
|
||||||
type_code acode;
|
type_code acode;
|
||||||
int32 acount;
|
int32 acount;
|
||||||
if (a.GetInfo(name, &acode, &acount) < B_OK)
|
if (a.GetInfo(name, &acode, &acount) < B_OK)
|
||||||
|
|||||||
+53
-5
@@ -58,9 +58,8 @@ bool LookUpFieldName(const char **name, const char *field_name, BMessage *names)
|
|||||||
|
|
||||||
status_t DumpMessageToStream(BMessage *message, BDataIO &stream, int tabCount, BMessage *names)
|
status_t DumpMessageToStream(BMessage *message, BDataIO &stream, int tabCount, BMessage *names)
|
||||||
{
|
{
|
||||||
int32 index;
|
int32 field, index;
|
||||||
void *cookie = NULL;
|
char *field_name;
|
||||||
const char *field_name;
|
|
||||||
type_code field_code;
|
type_code field_code;
|
||||||
int32 field_count;
|
int32 field_count;
|
||||||
char buffer[80];
|
char buffer[80];
|
||||||
@@ -93,10 +92,10 @@ status_t DumpMessageToStream(BMessage *message, BDataIO &stream, int tabCount, B
|
|||||||
// stream.Write(tabs+2, tabCount-2);
|
// stream.Write(tabs+2, tabCount-2);
|
||||||
stream.Write(buffer, strlen(buffer));
|
stream.Write(buffer, strlen(buffer));
|
||||||
|
|
||||||
while (message->GetNextName(&cookie,
|
for (field = 0; message->GetInfo(B_ANY_TYPE, field,
|
||||||
&field_name,
|
&field_name,
|
||||||
&field_code,
|
&field_code,
|
||||||
&field_count) == B_OK) {
|
&field_count) == B_OK; field++) {
|
||||||
if (LookUpFieldName(&easy_name, field_name, names)) {
|
if (LookUpFieldName(&easy_name, field_name, names)) {
|
||||||
stream.Write(tabs+1, tabCount);
|
stream.Write(tabs+1, tabCount);
|
||||||
stream.Write("// ", 3);
|
stream.Write("// ", 3);
|
||||||
@@ -121,6 +120,7 @@ status_t DumpMessageToStream(BMessage *message, BDataIO &stream, int tabCount, B
|
|||||||
DumpMessageToStream(&m, stream, tabCount, names);
|
DumpMessageToStream(&m, stream, tabCount, names);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef B_BEOS_VERSION_DANO
|
||||||
case 'FONt':
|
case 'FONt':
|
||||||
{
|
{
|
||||||
BFont f;
|
BFont f;
|
||||||
@@ -140,6 +140,54 @@ status_t DumpMessageToStream(BMessage *message, BDataIO &stream, int tabCount, B
|
|||||||
stream.Write("\n", 1);
|
stream.Write("\n", 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#else
|
||||||
|
case 'FONt':
|
||||||
|
{
|
||||||
|
BFont f;
|
||||||
|
const void *data;
|
||||||
|
ssize_t len;
|
||||||
|
if (message->FindData(field_name, index, &data, &len) >= B_OK) {
|
||||||
|
if (len <= (ssize_t)sizeof(f)) {
|
||||||
|
// Hack: only Dano has BFont : public BFlattenable
|
||||||
|
memcpy((void *)&f, data, len);
|
||||||
|
//stream << f;
|
||||||
|
font_family family;
|
||||||
|
font_style style;
|
||||||
|
font_height height;
|
||||||
|
f.GetFamilyAndStyle(&family, &style);
|
||||||
|
f.GetHeight(&height);
|
||||||
|
BString s;
|
||||||
|
s << "BFont(" << family;
|
||||||
|
s << "/" << style << "/" << f.Size();
|
||||||
|
s << ", shear=" << f.Shear();
|
||||||
|
s << ", rot=" << f.Rotation();
|
||||||
|
s << ", height=" << height.ascent;
|
||||||
|
s << "+" << height.descent;
|
||||||
|
s << "+" << height.leading << ")";
|
||||||
|
stream.Write(s.String(), s.Length());
|
||||||
|
} // else too big
|
||||||
|
}
|
||||||
|
stream.Write("\n", 1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case B_RGB_COLOR_TYPE:
|
||||||
|
{
|
||||||
|
rgb_color c;
|
||||||
|
const void *data;
|
||||||
|
ssize_t len;
|
||||||
|
if (message->FindData(field_name, index, &data, &len) >= B_OK) {
|
||||||
|
if (len <= (ssize_t)sizeof(c)) {
|
||||||
|
// Hack
|
||||||
|
memcpy((void *)&c, data, len);
|
||||||
|
sprintf(buffer, "rgb_color(%d,%d,%d,%d)",
|
||||||
|
c.red, c.green, c.blue, c.alpha);
|
||||||
|
stream.Write(buffer, strlen(buffer));
|
||||||
|
} // else too big
|
||||||
|
}
|
||||||
|
stream.Write("\n", 1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case B_BOOL_TYPE:
|
case B_BOOL_TYPE:
|
||||||
{
|
{
|
||||||
bool value;
|
bool value;
|
||||||
|
|||||||
+3
-1
@@ -165,7 +165,7 @@ status_t escape_find_directory(BString *dir)
|
|||||||
|
|
||||||
status_t unescape_find_directory(BString *dir)
|
status_t unescape_find_directory(BString *dir)
|
||||||
{
|
{
|
||||||
status_t err;
|
status_t err = B_ERROR;
|
||||||
int32 s, e;
|
int32 s, e;
|
||||||
BString tok;
|
BString tok;
|
||||||
BPath path;
|
BPath path;
|
||||||
@@ -180,7 +180,9 @@ status_t unescape_find_directory(BString *dir)
|
|||||||
|
|
||||||
_BORK(B_DESKTOP_DIRECTORY);
|
_BORK(B_DESKTOP_DIRECTORY);
|
||||||
_BORK(B_TRASH_DIRECTORY);
|
_BORK(B_TRASH_DIRECTORY);
|
||||||
|
#ifdef B_BEOS_VERSION_DANO
|
||||||
_BORK(B_ROOT_DIRECTORY);
|
_BORK(B_ROOT_DIRECTORY);
|
||||||
|
#endif
|
||||||
|
|
||||||
_BORK(B_BEOS_DIRECTORY);
|
_BORK(B_BEOS_DIRECTORY);
|
||||||
_BORK(B_BEOS_SYSTEM_DIRECTORY);
|
_BORK(B_BEOS_SYSTEM_DIRECTORY);
|
||||||
|
|||||||
+7
-1
@@ -5,6 +5,8 @@
|
|||||||
#include <Font.h>
|
#include <Font.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
|
#include <TypeConstants.h>
|
||||||
|
|
||||||
#include "DumpMessage.h"
|
#include "DumpMessage.h"
|
||||||
|
|
||||||
#define MAX_TEXT_LINE_INPUT_SIZE 4096
|
#define MAX_TEXT_LINE_INPUT_SIZE 4096
|
||||||
@@ -192,7 +194,7 @@ status_t Parse_Msg_rgb_color(BMessage *msg, TextLineInputDataIO *st, char *name)
|
|||||||
if (!has_alpha)
|
if (!has_alpha)
|
||||||
v.alpha = 255;
|
v.alpha = 255;
|
||||||
//msg->AddRGBColor(name, v);
|
//msg->AddRGBColor(name, v);
|
||||||
msg->AddData(name, (type_code)'RGBC', &v, 4);
|
msg->AddData(name, B_RGB_COLOR_TYPE, &v, 4);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,7 +257,11 @@ status_t Parse_Msg_BFont(BMessage *msg, TextLineInputDataIO *st, char *name)
|
|||||||
f.SetFamilyAndStyle(ff, fs);
|
f.SetFamilyAndStyle(ff, fs);
|
||||||
f.SetSize(size);
|
f.SetSize(size);
|
||||||
//f.PrintToStream();
|
//f.PrintToStream();
|
||||||
|
#ifdef B_BEOS_VERSION_DANO
|
||||||
msg->AddFlat(name, &f);
|
msg->AddFlat(name, &f);
|
||||||
|
#else
|
||||||
|
msg->AddData(name, 'FONt', (void *)&f, sizeof(f));
|
||||||
|
#endif
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+27
-3
@@ -2,10 +2,20 @@
|
|||||||
#include "ThemeInterfaceView.h"
|
#include "ThemeInterfaceView.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "UITheme.h"
|
#include "UITheme.h"
|
||||||
|
#include <BeBuild.h>
|
||||||
|
#ifdef B_ZETA_VERSION
|
||||||
#include <locale/Locale.h>
|
#include <locale/Locale.h>
|
||||||
|
#else
|
||||||
|
#define _T(v) v
|
||||||
|
#define B_LANGUAGE_CHANGED '_BLC'
|
||||||
|
#define B_PREF_APP_SET_DEFAULTS 'zPAD'
|
||||||
|
#define B_PREF_APP_REVERT 'zPAR'
|
||||||
|
#define B_PREF_APP_ADDON_REF 'zPAA'
|
||||||
|
#endif
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
#include <CheckBox.h>
|
#include <CheckBox.h>
|
||||||
#include <Font.h>
|
#include <Font.h>
|
||||||
|
#include <Roster.h>
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@@ -24,10 +34,16 @@ ThemeAddonItem::ThemeAddonItem(BRect bounds, ThemeInterfaceView *iview, int32 id
|
|||||||
tman = iview->GetThemeManager();
|
tman = iview->GetThemeManager();
|
||||||
fAddonName = tman->AddonName(id);
|
fAddonName = tman->AddonName(id);
|
||||||
BString tip(tman->AddonDescription(id));
|
BString tip(tman->AddonDescription(id));
|
||||||
|
#ifdef B_BEOS_VERSION_DANO
|
||||||
SetToolTipText(tip.String());
|
SetToolTipText(tip.String());
|
||||||
SetViewUIColor(B_UI_PANEL_BACKGROUND_COLOR);
|
SetViewUIColor(B_UI_PANEL_BACKGROUND_COLOR);
|
||||||
SetLowUIColor(B_UI_PANEL_BACKGROUND_COLOR);
|
SetLowUIColor(B_UI_PANEL_BACKGROUND_COLOR);
|
||||||
SetHighUIColor(B_UI_PANEL_TEXT_COLOR);
|
SetHighUIColor(B_UI_PANEL_TEXT_COLOR);
|
||||||
|
#else
|
||||||
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
SetHighColor(ui_color(B_PANEL_TEXT_COLOR));
|
||||||
|
#endif
|
||||||
BMessage *apply = new BMessage(CB_APPLY);
|
BMessage *apply = new BMessage(CB_APPLY);
|
||||||
apply->AddInt32("addon", id);
|
apply->AddInt32("addon", id);
|
||||||
BMessage *save = new BMessage(CB_SAVE);
|
BMessage *save = new BMessage(CB_SAVE);
|
||||||
@@ -35,14 +51,18 @@ ThemeAddonItem::ThemeAddonItem(BRect bounds, ThemeInterfaceView *iview, int32 id
|
|||||||
BMessage *prefs = new BMessage(BTN_PREFS);
|
BMessage *prefs = new BMessage(BTN_PREFS);
|
||||||
prefs->AddInt32("addon", id);
|
prefs->AddInt32("addon", id);
|
||||||
fApplyBox = new BCheckBox(BRect(CTRL_OFF_X, CTRL_OFF_Y, CTRL_OFF_X+50, CTRL_OFF_Y+30), "apply", _T("Apply"), apply);
|
fApplyBox = new BCheckBox(BRect(CTRL_OFF_X, CTRL_OFF_Y, CTRL_OFF_X+50, CTRL_OFF_Y+30), "apply", _T("Apply"), apply);
|
||||||
fApplyBox->SetToolTipText(_T("Use this information from themes"));
|
|
||||||
fApplyBox->SetValue((tman->AddonFlags(id) & Z_THEME_ADDON_DO_SET_ALL)?B_CONTROL_ON:B_CONTROL_OFF);
|
fApplyBox->SetValue((tman->AddonFlags(id) & Z_THEME_ADDON_DO_SET_ALL)?B_CONTROL_ON:B_CONTROL_OFF);
|
||||||
fSaveBox = new BCheckBox(BRect(CTRL_OFF_X+50+CTRL_SPACING, CTRL_OFF_Y, CTRL_OFF_X+100+CTRL_SPACING, CTRL_OFF_Y+30), "save", _T("Save"), save);
|
fSaveBox = new BCheckBox(BRect(CTRL_OFF_X+50+CTRL_SPACING, CTRL_OFF_Y, CTRL_OFF_X+100+CTRL_SPACING, CTRL_OFF_Y+30), "save", _T("Save"), save);
|
||||||
fSaveBox->SetToolTipText(_T("Save this information to themes"));
|
|
||||||
fSaveBox->SetValue((tman->AddonFlags(id) & Z_THEME_ADDON_DO_RETRIEVE)?B_CONTROL_ON:B_CONTROL_OFF);
|
fSaveBox->SetValue((tman->AddonFlags(id) & Z_THEME_ADDON_DO_RETRIEVE)?B_CONTROL_ON:B_CONTROL_OFF);
|
||||||
|
#ifdef B_BEOS_VERSION_DANO
|
||||||
|
fApplyBox->SetToolTipText(_T("Use this information from themes"));
|
||||||
|
fSaveBox->SetToolTipText(_T("Save this information to themes"));
|
||||||
|
#endif
|
||||||
#ifdef HAVE_PREF_BTN
|
#ifdef HAVE_PREF_BTN
|
||||||
fPrefsBtn = new BButton(BRect(CTRL_OFF_X+100+CTRL_SPACING*2, CTRL_OFF_Y, CTRL_OFF_X+150+CTRL_SPACING*2, CTRL_OFF_Y+30), "prefs", _T("Preferences"), prefs);
|
fPrefsBtn = new BButton(BRect(CTRL_OFF_X+100+CTRL_SPACING*2, CTRL_OFF_Y, CTRL_OFF_X+150+CTRL_SPACING*2, CTRL_OFF_Y+30), "prefs", _T("Preferences"), prefs);
|
||||||
|
#ifdef B_BEOS_VERSION_DANO
|
||||||
fPrefsBtn->SetToolTipText(_T("Run the preferences panel for this topic."));
|
fPrefsBtn->SetToolTipText(_T("Run the preferences panel for this topic."));
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
BFont fnt;
|
BFont fnt;
|
||||||
GetFont(&fnt);
|
GetFont(&fnt);
|
||||||
@@ -95,12 +115,16 @@ void ThemeAddonItem::Draw(BRect)
|
|||||||
void ThemeAddonItem::RelocalizeStrings()
|
void ThemeAddonItem::RelocalizeStrings()
|
||||||
{
|
{
|
||||||
fApplyBox->SetLabel(_T("Apply"));
|
fApplyBox->SetLabel(_T("Apply"));
|
||||||
fApplyBox->SetToolTipText(_T("Use this information from themes"));
|
|
||||||
fSaveBox->SetLabel(_T("Save"));
|
fSaveBox->SetLabel(_T("Save"));
|
||||||
|
#ifdef B_BEOS_VERSION_DANO
|
||||||
|
fApplyBox->SetToolTipText(_T("Use this information from themes"));
|
||||||
fSaveBox->SetToolTipText(_T("Save this information to themes"));
|
fSaveBox->SetToolTipText(_T("Save this information to themes"));
|
||||||
|
#endif
|
||||||
#ifdef HAVE_PREF_BTN
|
#ifdef HAVE_PREF_BTN
|
||||||
fPrefsBtn->SetLabel(_T("Preferences"));
|
fPrefsBtn->SetLabel(_T("Preferences"));
|
||||||
|
#ifdef B_BEOS_VERSION_DANO
|
||||||
fPrefsBtn->SetToolTipText(_T("Run the preferences panel for this topic."));
|
fPrefsBtn->SetToolTipText(_T("Run the preferences panel for this topic."));
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
RelayoutButtons();
|
RelayoutButtons();
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-3
@@ -1,16 +1,25 @@
|
|||||||
#include <add-ons/pref_app/PrefPanel.h>
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
#include <DataIO.h>
|
#include <DataIO.h>
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
|
#include <BeBuild.h>
|
||||||
|
#ifdef B_ZETA_VERSION
|
||||||
|
#include <add-ons/pref_app/PrefPanel.h>
|
||||||
#include <locale/Locale.h>
|
#include <locale/Locale.h>
|
||||||
#include <Resources.h>
|
|
||||||
#include <Separator.h>
|
#include <Separator.h>
|
||||||
|
#else
|
||||||
|
#define _T(v) v
|
||||||
|
#define B_PREF_APP_ENABLE_REVERT 'zPAE'
|
||||||
|
#define B_PREF_APP_SET_DEFAULTS 'zPAD'
|
||||||
|
#define B_PREF_APP_REVERT 'zPAR'
|
||||||
|
#define B_PREF_APP_ADDON_REF 'zPAA'
|
||||||
|
#endif
|
||||||
|
#include <Resources.h>
|
||||||
#include <TranslationUtils.h>
|
#include <TranslationUtils.h>
|
||||||
#include <TranslatorFormats.h>
|
#include <TranslatorFormats.h>
|
||||||
#include <be/app/Roster.h>
|
#include <Roster.h>
|
||||||
|
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
#include <ListView.h>
|
#include <ListView.h>
|
||||||
@@ -21,6 +30,8 @@
|
|||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <MessageFilter.h>
|
#include <MessageFilter.h>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "UITheme.h"
|
#include "UITheme.h"
|
||||||
#include "TextInputAlert.h"
|
#include "TextInputAlert.h"
|
||||||
|
|
||||||
@@ -103,7 +114,11 @@ ThemeInterfaceView::AllAttached()
|
|||||||
BView::AllAttached();
|
BView::AllAttached();
|
||||||
|
|
||||||
fPopupInvoker = new BInvoker(new BMessage(kReallyCreateTheme), this);
|
fPopupInvoker = new BInvoker(new BMessage(kReallyCreateTheme), this);
|
||||||
|
#ifdef B_BEOS_VERSION_DANO
|
||||||
SetViewUIColor(B_UI_PANEL_BACKGROUND_COLOR);
|
SetViewUIColor(B_UI_PANEL_BACKGROUND_COLOR);
|
||||||
|
#else
|
||||||
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
#endif
|
||||||
|
|
||||||
fThemeManager = new ThemeManager;
|
fThemeManager = new ThemeManager;
|
||||||
fThemeManager->LoadThemes();
|
fThemeManager->LoadThemes();
|
||||||
|
|||||||
Reference in New Issue
Block a user