Automatic whitespace cleanup. No functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39102 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
// ActiveTranslatorsWindow.cpp
|
// ActiveTranslatorsWindow.cpp
|
||||||
//
|
//
|
||||||
// BWindow class for displaying information about the currently open
|
// BWindow class for displaying information about the currently open
|
||||||
// document
|
// document
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Copyright (c) 2003 OpenBeOS Project
|
// Copyright (c) 2003 OpenBeOS Project
|
||||||
@@ -13,18 +13,18 @@
|
|||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be included
|
// The above copyright notice and this permission notice shall be included
|
||||||
// in all copies or substantial portions of the Software.
|
// in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -53,7 +53,7 @@ ActiveTranslatorsWindow::ActiveTranslatorsWindow(BRect rect, const char *name,
|
|||||||
{
|
{
|
||||||
BRect rctframe = Bounds();
|
BRect rctframe = Bounds();
|
||||||
rctframe.right -= B_V_SCROLL_BAR_WIDTH;
|
rctframe.right -= B_V_SCROLL_BAR_WIDTH;
|
||||||
|
|
||||||
fpListView = new BOutlineListView(rctframe, "translators_list",
|
fpListView = new BOutlineListView(rctframe, "translators_list",
|
||||||
B_MULTIPLE_SELECTION_LIST);
|
B_MULTIPLE_SELECTION_LIST);
|
||||||
|
|
||||||
@@ -63,12 +63,12 @@ ActiveTranslatorsWindow::ActiveTranslatorsWindow(BRect rect, const char *name,
|
|||||||
fpSystemItem->SetEnabled(false);
|
fpSystemItem->SetEnabled(false);
|
||||||
AddTranslatorsToList(plist, USER_TRANSLATOR, fpUserItem);
|
AddTranslatorsToList(plist, USER_TRANSLATOR, fpUserItem);
|
||||||
AddTranslatorsToList(plist, SYSTEM_TRANSLATOR, fpSystemItem);
|
AddTranslatorsToList(plist, SYSTEM_TRANSLATOR, fpSystemItem);
|
||||||
|
|
||||||
AddChild(new BScrollView("scroll_list", fpListView, B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
AddChild(new BScrollView("scroll_list", fpListView, B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||||
0, false, true));
|
0, false, true));
|
||||||
|
|
||||||
SetSizeLimits(100, 10000, 100, 10000);
|
SetSizeLimits(100, 10000, 100, 10000);
|
||||||
|
|
||||||
Show();
|
Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
// ActiveTranslatorsWindow.h
|
// ActiveTranslatorsWindow.h
|
||||||
//
|
//
|
||||||
// BWindow class for displaying information about the currently open
|
// BWindow class for displaying information about the currently open
|
||||||
// document
|
// document
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Copyright (c) 2003 OpenBeOS Project
|
// Copyright (c) 2003 OpenBeOS Project
|
||||||
@@ -13,18 +13,18 @@
|
|||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be included
|
// The above copyright notice and this permission notice shall be included
|
||||||
// in all copies or substantial portions of the Software.
|
// in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -43,10 +43,10 @@ public:
|
|||||||
void FrameResized(float width, float height);
|
void FrameResized(float width, float height);
|
||||||
void MessageReceived(BMessage *pmsg);
|
void MessageReceived(BMessage *pmsg);
|
||||||
void Quit();
|
void Quit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AddTranslatorsToList(BList *plist, int32 group, BStringItem *pparent);
|
void AddTranslatorsToList(BList *plist, int32 group, BStringItem *pparent);
|
||||||
|
|
||||||
BOutlineListView *fpListView;
|
BOutlineListView *fpListView;
|
||||||
BStringItem *fpUserItem;
|
BStringItem *fpUserItem;
|
||||||
BStringItem *fpSystemItem;
|
BStringItem *fpSystemItem;
|
||||||
|
|||||||
@@ -12,18 +12,18 @@
|
|||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be included
|
// The above copyright notice and this permission notice shall be included
|
||||||
// in all copies or substantial portions of the Software.
|
// in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
@@ -14,18 +14,18 @@
|
|||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be included
|
// The above copyright notice and this permission notice shall be included
|
||||||
// in all copies or substantial portions of the Software.
|
// in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -70,7 +70,7 @@ ImageView::ImageView(BRect rect, const char *name)
|
|||||||
fpbitmap = NULL;
|
fpbitmap = NULL;
|
||||||
fdocumentIndex = 1;
|
fdocumentIndex = 1;
|
||||||
fdocumentCount = 1;
|
fdocumentCount = 1;
|
||||||
|
|
||||||
SetViewColor(192, 192, 192);
|
SetViewColor(192, 192, 192);
|
||||||
SetHighColor(0, 0, 0);
|
SetHighColor(0, 0, 0);
|
||||||
SetPenSize(PEN_SIZE);
|
SetPenSize(PEN_SIZE);
|
||||||
@@ -101,7 +101,7 @@ ImageView::Draw(BRect rect)
|
|||||||
BORDER_HEIGHT - PEN_SIZE,
|
BORDER_HEIGHT - PEN_SIZE,
|
||||||
fpbitmap->Bounds().Width() + BORDER_WIDTH + PEN_SIZE,
|
fpbitmap->Bounds().Width() + BORDER_WIDTH + PEN_SIZE,
|
||||||
fpbitmap->Bounds().Height() + BORDER_HEIGHT + PEN_SIZE));
|
fpbitmap->Bounds().Height() + BORDER_HEIGHT + PEN_SIZE));
|
||||||
|
|
||||||
DrawBitmap(fpbitmap, BPoint(BORDER_WIDTH, BORDER_HEIGHT));
|
DrawBitmap(fpbitmap, BPoint(BORDER_WIDTH, BORDER_HEIGHT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ ImageView::MouseDown(BPoint point)
|
|||||||
{
|
{
|
||||||
if (!HasImage())
|
if (!HasImage())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Only accept left button clicks
|
// Only accept left button clicks
|
||||||
BMessage *pmsg = Window()->CurrentMessage();
|
BMessage *pmsg = Window()->CurrentMessage();
|
||||||
int32 button = pmsg->FindInt32("buttons");
|
int32 button = pmsg->FindInt32("buttons");
|
||||||
@@ -170,7 +170,7 @@ ImageView::MessageReceived(BMessage *pmsg)
|
|||||||
case B_COPY_TARGET:
|
case B_COPY_TARGET:
|
||||||
SaveImageAtDropLocation(pmsg);
|
SaveImageAtDropLocation(pmsg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BView::MessageReceived(pmsg);
|
BView::MessageReceived(pmsg);
|
||||||
break;
|
break;
|
||||||
@@ -184,9 +184,9 @@ ImageView::SaveImageAtDropLocation(BMessage *pmsg)
|
|||||||
// Find the location and name of the drop and
|
// Find the location and name of the drop and
|
||||||
// write the image file there
|
// write the image file there
|
||||||
BBitmapStream stream(fpbitmap);
|
BBitmapStream stream(fpbitmap);
|
||||||
|
|
||||||
StatusCheck chk;
|
StatusCheck chk;
|
||||||
// throw an exception if this is assigned
|
// throw an exception if this is assigned
|
||||||
// anything other than B_OK
|
// anything other than B_OK
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -194,21 +194,21 @@ ImageView::SaveImageAtDropLocation(BMessage *pmsg)
|
|||||||
chk = pmsg->FindRef("directory", &dirref);
|
chk = pmsg->FindRef("directory", &dirref);
|
||||||
const char *filename;
|
const char *filename;
|
||||||
chk = pmsg->FindString("name", &filename);
|
chk = pmsg->FindString("name", &filename);
|
||||||
|
|
||||||
BDirectory dir(&dirref);
|
BDirectory dir(&dirref);
|
||||||
BFile file(&dir, filename, B_WRITE_ONLY | B_CREATE_FILE);
|
BFile file(&dir, filename, B_WRITE_ONLY | B_CREATE_FILE);
|
||||||
chk = file.InitCheck();
|
chk = file.InitCheck();
|
||||||
|
|
||||||
BTranslatorRoster *proster = BTranslatorRoster::Default();
|
BTranslatorRoster *proster = BTranslatorRoster::Default();
|
||||||
chk = proster->Translate(&stream, NULL, NULL, &file, B_TGA_FORMAT);
|
chk = proster->Translate(&stream, NULL, NULL, &file, B_TGA_FORMAT);
|
||||||
|
|
||||||
} catch (StatusNotOKException) {
|
} catch (StatusNotOKException) {
|
||||||
BAlert *palert = new BAlert(NULL,
|
BAlert *palert = new BAlert(NULL,
|
||||||
B_TRANSLATE("Sorry, unable to write the image file."),
|
B_TRANSLATE("Sorry, unable to write the image file."),
|
||||||
B_TRANSLATE("OK"));
|
B_TRANSLATE("OK"));
|
||||||
palert->Go();
|
palert->Go();
|
||||||
}
|
}
|
||||||
|
|
||||||
stream.DetachBitmap(&fpbitmap);
|
stream.DetachBitmap(&fpbitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ ImageView::AdjustScrollBars()
|
|||||||
BRect rctview = Bounds(), rctbitmap(0, 0, 0, 0);
|
BRect rctview = Bounds(), rctbitmap(0, 0, 0, 0);
|
||||||
if (HasImage())
|
if (HasImage())
|
||||||
rctbitmap = fpbitmap->Bounds();
|
rctbitmap = fpbitmap->Bounds();
|
||||||
|
|
||||||
float prop, range;
|
float prop, range;
|
||||||
BScrollBar *psb = ScrollBar(B_HORIZONTAL);
|
BScrollBar *psb = ScrollBar(B_HORIZONTAL);
|
||||||
if (psb) {
|
if (psb) {
|
||||||
@@ -231,7 +231,7 @@ ImageView::AdjustScrollBars()
|
|||||||
psb->SetProportion(prop);
|
psb->SetProportion(prop);
|
||||||
psb->SetSteps(10, 100);
|
psb->SetSteps(10, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
psb = ScrollBar(B_VERTICAL);
|
psb = ScrollBar(B_VERTICAL);
|
||||||
if (psb) {
|
if (psb) {
|
||||||
range = rctbitmap.Height() + (BORDER_HEIGHT * 2) - rctview.Height();
|
range = rctbitmap.Height() + (BORDER_HEIGHT * 2) - rctview.Height();
|
||||||
@@ -245,7 +245,7 @@ ImageView::AdjustScrollBars()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct ColorSpaceName {
|
struct ColorSpaceName {
|
||||||
color_space id;
|
color_space id;
|
||||||
const char *name;
|
const char *name;
|
||||||
};
|
};
|
||||||
@@ -323,7 +323,7 @@ hex_format(uint32 num)
|
|||||||
{
|
{
|
||||||
static char str[11] = { 0 };
|
static char str[11] = { 0 };
|
||||||
sprintf(str, "0x%.8lx", num);
|
sprintf(str, "0x%.8lx", num);
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ char_format(uint32 num)
|
|||||||
static char str[5] = { 0 };
|
static char str[5] = { 0 };
|
||||||
uint32 bnum = B_HOST_TO_BENDIAN_INT32(num);
|
uint32 bnum = B_HOST_TO_BENDIAN_INT32(num);
|
||||||
memcpy(str, &bnum, 4);
|
memcpy(str, &bnum, 4);
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -428,7 +428,7 @@ ImageView::UpdateInfoWindow(const BPath &path, BMessage &ioExtension,
|
|||||||
str2[0] = '\0';
|
str2[0] = '\0';
|
||||||
sprintf(str2, "%f", tinfo.capability);
|
sprintf(str2, "%f", tinfo.capability);
|
||||||
bstr.ReplaceFirst("%16", str2);
|
bstr.ReplaceFirst("%16", str2);
|
||||||
|
|
||||||
int32 document_count = 0, document_index = 0;
|
int32 document_count = 0, document_index = 0;
|
||||||
// Translator Info
|
// Translator Info
|
||||||
const char *tranname = NULL, *traninfo = NULL;
|
const char *tranname = NULL, *traninfo = NULL;
|
||||||
@@ -468,7 +468,7 @@ ImageView::UpdateInfoWindow(const BPath &path, BMessage &ioExtension,
|
|||||||
bstr.Append(str.String());
|
bstr.Append(str.String());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (proster->GetTranslatorInfo(tinfo.translator, &tranname,
|
if (proster->GetTranslatorInfo(tinfo.translator, &tranname,
|
||||||
&traninfo, &tranversion) == B_OK) {
|
&traninfo, &tranversion) == B_OK) {
|
||||||
BString str = B_TRANSLATE("\nTranslator Used:\n"
|
BString str = B_TRANSLATE("\nTranslator Used:\n"
|
||||||
"Name: %1\n"
|
"Name: %1\n"
|
||||||
@@ -520,7 +520,7 @@ ImageView::SelectTranslatorRoster(BTranslatorRoster &roster)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bNoneSelected)
|
if (bNoneSelected)
|
||||||
return BTranslatorRoster::Default();
|
return BTranslatorRoster::Default();
|
||||||
else
|
else
|
||||||
@@ -533,16 +533,16 @@ ImageView::SetImage(BMessage *pmsg)
|
|||||||
{
|
{
|
||||||
// Replace current image with the image
|
// Replace current image with the image
|
||||||
// specified in the given BMessage
|
// specified in the given BMessage
|
||||||
|
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
if (!pmsg)
|
if (!pmsg)
|
||||||
ref = fcurrentRef;
|
ref = fcurrentRef;
|
||||||
else if (pmsg->FindRef("refs", &ref) != B_OK)
|
else if (pmsg->FindRef("refs", &ref) != B_OK)
|
||||||
// If refs not found, just ignore the message
|
// If refs not found, just ignore the message
|
||||||
return;
|
return;
|
||||||
|
|
||||||
StatusCheck chk;
|
StatusCheck chk;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BFile file(&ref, B_READ_ONLY);
|
BFile file(&ref, B_READ_ONLY);
|
||||||
chk = file.InitCheck();
|
chk = file.InitCheck();
|
||||||
@@ -561,7 +561,7 @@ ImageView::SetImage(BMessage *pmsg)
|
|||||||
chk = ioExtension.AddInt32("/documentIndex", fdocumentIndex);
|
chk = ioExtension.AddInt32("/documentIndex", fdocumentIndex);
|
||||||
chk = proster->Identify(&file, &ioExtension, &tinfo, 0, NULL,
|
chk = proster->Identify(&file, &ioExtension, &tinfo, 0, NULL,
|
||||||
B_TRANSLATOR_BITMAP);
|
B_TRANSLATOR_BITMAP);
|
||||||
|
|
||||||
// perform the actual translation
|
// perform the actual translation
|
||||||
BBitmapStream outstream;
|
BBitmapStream outstream;
|
||||||
chk = proster->Translate(&file, &tinfo, &ioExtension, &outstream,
|
chk = proster->Translate(&file, &tinfo, &ioExtension, &outstream,
|
||||||
@@ -579,7 +579,7 @@ ImageView::SetImage(BMessage *pmsg)
|
|||||||
fdocumentCount = documentCount;
|
fdocumentCount = documentCount;
|
||||||
else
|
else
|
||||||
fdocumentCount = 1;
|
fdocumentCount = 1;
|
||||||
|
|
||||||
// Set the name of the Window to reflect the file name
|
// Set the name of the Window to reflect the file name
|
||||||
BWindow *pwin = Window();
|
BWindow *pwin = Window();
|
||||||
BEntry entry(&ref);
|
BEntry entry(&ref);
|
||||||
@@ -593,7 +593,7 @@ ImageView::SetImage(BMessage *pmsg)
|
|||||||
pwin->SetTitle(IMAGEWINDOW_TITLE);
|
pwin->SetTitle(IMAGEWINDOW_TITLE);
|
||||||
UpdateInfoWindow(path, ioExtension, tinfo, proster);
|
UpdateInfoWindow(path, ioExtension, tinfo, proster);
|
||||||
|
|
||||||
// Resize parent window and set size limits to
|
// Resize parent window and set size limits to
|
||||||
// reflect the size of the new bitmap
|
// reflect the size of the new bitmap
|
||||||
float width, height;
|
float width, height;
|
||||||
BMenuBar *pbar = pwin->KeyMenuBar();
|
BMenuBar *pbar = pwin->KeyMenuBar();
|
||||||
@@ -619,13 +619,13 @@ ImageView::SetImage(BMessage *pmsg)
|
|||||||
// HACK: Need to fix case where window un-zooms
|
// HACK: Need to fix case where window un-zooms
|
||||||
// when the window is already the correct size
|
// when the window is already the correct size
|
||||||
// for the current image
|
// for the current image
|
||||||
|
|
||||||
// repaint view
|
// repaint view
|
||||||
Invalidate();
|
Invalidate();
|
||||||
|
|
||||||
} catch (StatusNotOKException) {
|
} catch (StatusNotOKException) {
|
||||||
BAlert *palert = new BAlert(NULL,
|
BAlert *palert = new BAlert(NULL,
|
||||||
B_TRANSLATE("Sorry, unable to load the image."),
|
B_TRANSLATE("Sorry, unable to load the image."),
|
||||||
B_TRANSLATE("OK"));
|
B_TRANSLATE("OK"));
|
||||||
palert->Go();
|
palert->Go();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,18 +14,18 @@
|
|||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be included
|
// The above copyright notice and this permission notice shall be included
|
||||||
// in all copies or substantial portions of the Software.
|
// in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -43,7 +43,7 @@ class ImageView : public BView {
|
|||||||
public:
|
public:
|
||||||
ImageView(BRect rect, const char *name);
|
ImageView(BRect rect, const char *name);
|
||||||
~ImageView();
|
~ImageView();
|
||||||
|
|
||||||
void AttachedToWindow();
|
void AttachedToWindow();
|
||||||
void Draw(BRect rect);
|
void Draw(BRect rect);
|
||||||
void FrameResized(float width, float height);
|
void FrameResized(float width, float height);
|
||||||
@@ -51,24 +51,24 @@ public:
|
|||||||
void MouseMoved(BPoint point, uint32 state, const BMessage *pmsg);
|
void MouseMoved(BPoint point, uint32 state, const BMessage *pmsg);
|
||||||
void MouseUp(BPoint point);
|
void MouseUp(BPoint point);
|
||||||
void MessageReceived(BMessage *pmsg);
|
void MessageReceived(BMessage *pmsg);
|
||||||
|
|
||||||
void SetImage(BMessage *pmsg);
|
void SetImage(BMessage *pmsg);
|
||||||
bool HasImage() { return fpbitmap ? true : false; };
|
bool HasImage() { return fpbitmap ? true : false; };
|
||||||
|
|
||||||
void FirstPage();
|
void FirstPage();
|
||||||
void LastPage();
|
void LastPage();
|
||||||
void NextPage();
|
void NextPage();
|
||||||
void PrevPage();
|
void PrevPage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void UpdateInfoWindow(const BPath &path, BMessage &ioExtension,
|
void UpdateInfoWindow(const BPath &path, BMessage &ioExtension,
|
||||||
const translator_info &info, BTranslatorRoster *proster);
|
const translator_info &info, BTranslatorRoster *proster);
|
||||||
void ReDraw();
|
void ReDraw();
|
||||||
void AdjustScrollBars();
|
void AdjustScrollBars();
|
||||||
void SaveImageAtDropLocation(BMessage *pmsg);
|
void SaveImageAtDropLocation(BMessage *pmsg);
|
||||||
|
|
||||||
BTranslatorRoster *SelectTranslatorRoster(BTranslatorRoster &roster);
|
BTranslatorRoster *SelectTranslatorRoster(BTranslatorRoster &roster);
|
||||||
|
|
||||||
entry_ref fcurrentRef;
|
entry_ref fcurrentRef;
|
||||||
int32 fdocumentIndex;
|
int32 fdocumentIndex;
|
||||||
int32 fdocumentCount;
|
int32 fdocumentCount;
|
||||||
|
|||||||
@@ -138,12 +138,12 @@ ImageWindow::MessageReceived(BMessage *pmsg)
|
|||||||
case M_SAVE_IMAGE:
|
case M_SAVE_IMAGE:
|
||||||
if (fpimageView->HasImage()) {
|
if (fpimageView->HasImage()) {
|
||||||
BAlert *palert = new BAlert(NULL,
|
BAlert *palert = new BAlert(NULL,
|
||||||
B_TRANSLATE("Save feature not implemented yet."),
|
B_TRANSLATE("Save feature not implemented yet."),
|
||||||
B_TRANSLATE("Bummer"));
|
B_TRANSLATE("Bummer"));
|
||||||
palert->Go();
|
palert->Go();
|
||||||
} else {
|
} else {
|
||||||
BAlert *palert = new BAlert(NULL,
|
BAlert *palert = new BAlert(NULL,
|
||||||
B_TRANSLATE("No image available to save."),
|
B_TRANSLATE("No image available to save."),
|
||||||
B_TRANSLATE("OK"));
|
B_TRANSLATE("OK"));
|
||||||
palert->Go();
|
palert->Go();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
// ImageWindow.h
|
// ImageWindow.h
|
||||||
//
|
//
|
||||||
// BWindow class for displaying an image. Uses ImageView class for its
|
// BWindow class for displaying an image. Uses ImageView class for its
|
||||||
// view.
|
// view.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Copyright (c) 2003 OpenBeOS Project
|
// Copyright (c) 2003 OpenBeOS Project
|
||||||
@@ -13,18 +13,18 @@
|
|||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be included
|
// The above copyright notice and this permission notice shall be included
|
||||||
// in all copies or substantial portions of the Software.
|
// in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
~ImageWindow();
|
~ImageWindow();
|
||||||
void MessageReceived(BMessage *pmsg);
|
void MessageReceived(BMessage *pmsg);
|
||||||
bool QuitRequested();
|
bool QuitRequested();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BFilePanel *fpopenPanel;
|
BFilePanel *fpopenPanel;
|
||||||
ImageView *fpimageView;
|
ImageView *fpimageView;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
// InfoWindow.cpp
|
// InfoWindow.cpp
|
||||||
//
|
//
|
||||||
// BWindow class for displaying information about the currently open
|
// BWindow class for displaying information about the currently open
|
||||||
// document
|
// document
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Copyright (c) 2003 OpenBeOS Project
|
// Copyright (c) 2003 OpenBeOS Project
|
||||||
@@ -13,18 +13,18 @@
|
|||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be included
|
// The above copyright notice and this permission notice shall be included
|
||||||
// in all copies or substantial portions of the Software.
|
// in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -42,22 +42,22 @@ InfoWindow::InfoWindow(BRect rect, const char *name, const char *text)
|
|||||||
BRect rctframe = Bounds();
|
BRect rctframe = Bounds();
|
||||||
rctframe.right -= B_V_SCROLL_BAR_WIDTH;
|
rctframe.right -= B_V_SCROLL_BAR_WIDTH;
|
||||||
rctframe.bottom -= B_H_SCROLL_BAR_HEIGHT;
|
rctframe.bottom -= B_H_SCROLL_BAR_HEIGHT;
|
||||||
|
|
||||||
BRect rcttext = rctframe;
|
BRect rcttext = rctframe;
|
||||||
rcttext.OffsetTo(B_ORIGIN);
|
rcttext.OffsetTo(B_ORIGIN);
|
||||||
|
|
||||||
fptextView = new BTextView(rctframe, "infoview", rcttext,
|
fptextView = new BTextView(rctframe, "infoview", rcttext,
|
||||||
B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_PULSE_NEEDED);
|
B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_PULSE_NEEDED);
|
||||||
|
|
||||||
BScrollView *psv;
|
BScrollView *psv;
|
||||||
AddChild(psv = new BScrollView("infoscrollview", fptextView,
|
AddChild(psv = new BScrollView("infoscrollview", fptextView,
|
||||||
B_FOLLOW_ALL_SIDES, 0, true, true));
|
B_FOLLOW_ALL_SIDES, 0, true, true));
|
||||||
fptextView->MakeEditable(false);
|
fptextView->MakeEditable(false);
|
||||||
//fptextView->MakeResizable(true);
|
//fptextView->MakeResizable(true);
|
||||||
fptextView->SetText(text);
|
fptextView->SetText(text);
|
||||||
|
|
||||||
SetSizeLimits(100, 10000, 100, 10000);
|
SetSizeLimits(100, 10000, 100, 10000);
|
||||||
|
|
||||||
Show();
|
Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ void
|
|||||||
InfoWindow::FrameResized(float width, float height)
|
InfoWindow::FrameResized(float width, float height)
|
||||||
{
|
{
|
||||||
BRect rcttext = fptextView->TextRect();
|
BRect rcttext = fptextView->TextRect();
|
||||||
|
|
||||||
rcttext.right = rcttext.left + (width - B_V_SCROLL_BAR_WIDTH);
|
rcttext.right = rcttext.left + (width - B_V_SCROLL_BAR_WIDTH);
|
||||||
fptextView->SetTextRect(rcttext);
|
fptextView->SetTextRect(rcttext);
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ InfoWindow::MessageReceived(BMessage *pmsg)
|
|||||||
fptextView->SetText(bstr.String());
|
fptextView->SetText(bstr.String());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BWindow::MessageReceived(pmsg);
|
BWindow::MessageReceived(pmsg);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
// InfoWindow.h
|
// InfoWindow.h
|
||||||
//
|
//
|
||||||
// BWindow class for displaying information about the currently open
|
// BWindow class for displaying information about the currently open
|
||||||
// document
|
// document
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Copyright (c) 2003 OpenBeOS Project
|
// Copyright (c) 2003 OpenBeOS Project
|
||||||
@@ -13,18 +13,18 @@
|
|||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be included
|
// The above copyright notice and this permission notice shall be included
|
||||||
// in all copies or substantial portions of the Software.
|
// in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -43,7 +43,7 @@ public:
|
|||||||
void FrameResized(float width, float height);
|
void FrameResized(float width, float height);
|
||||||
void MessageReceived(BMessage *pmsg);
|
void MessageReceived(BMessage *pmsg);
|
||||||
void Quit();
|
void Quit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BTextView *fptextView;
|
BTextView *fptextView;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,18 +13,18 @@
|
|||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be included
|
// The above copyright notice and this permission notice shall be included
|
||||||
// in all copies or substantial portions of the Software.
|
// in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -44,6 +44,6 @@ StatusCheck::operator=(status_t ret)
|
|||||||
{
|
{
|
||||||
if (ret != B_OK)
|
if (ret != B_OK)
|
||||||
throw StatusNotOKException();
|
throw StatusNotOKException();
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,18 +13,18 @@
|
|||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be included
|
// The above copyright notice and this permission notice shall be included
|
||||||
// in all copies or substantial portions of the Software.
|
// in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
//
|
//
|
||||||
// BTranslatorItem.cpp
|
// BTranslatorItem.cpp
|
||||||
//
|
//
|
||||||
// BStringItem based class for using a list of Translators in a BListView
|
// BStringItem based class for using a list of Translators in a BListView
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Copyright (c) 2003 OpenBeOS Project
|
// Copyright (c) 2003 OpenBeOS Project
|
||||||
@@ -12,18 +12,18 @@
|
|||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be included
|
// The above copyright notice and this permission notice shall be included
|
||||||
// in all copies or substantial portions of the Software.
|
// in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -35,7 +35,7 @@ BTranslatorItem::BTranslatorItem(const char *text, const char *path, int32 group
|
|||||||
{
|
{
|
||||||
fpath.SetTo(path);
|
fpath.SetTo(path);
|
||||||
fgroup = UNKNOWN_GROUP;
|
fgroup = UNKNOWN_GROUP;
|
||||||
|
|
||||||
if (group == SYSTEM_TRANSLATOR || group == USER_TRANSLATOR)
|
if (group == SYSTEM_TRANSLATOR || group == USER_TRANSLATOR)
|
||||||
fgroup = group;
|
fgroup = group;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
//
|
//
|
||||||
// BTranslatorItem.h
|
// BTranslatorItem.h
|
||||||
//
|
//
|
||||||
// BStringItem based class for using a list of Translators in a BListView
|
// BStringItem based class for using a list of Translators in a BListView
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Copyright (c) 2003 OpenBeOS Project
|
// Copyright (c) 2003 OpenBeOS Project
|
||||||
@@ -12,18 +12,18 @@
|
|||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
// to deal in the Software without restriction, including without limitation
|
// to deal in the Software without restriction, including without limitation
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be included
|
// The above copyright notice and this permission notice shall be included
|
||||||
// in all copies or substantial portions of the Software.
|
// in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -44,10 +44,10 @@ enum {
|
|||||||
class BTranslatorItem : public BStringItem {
|
class BTranslatorItem : public BStringItem {
|
||||||
public:
|
public:
|
||||||
BTranslatorItem(const char *text, const char *path, int32 group);
|
BTranslatorItem(const char *text, const char *path, int32 group);
|
||||||
|
|
||||||
const char *Path() const;
|
const char *Path() const;
|
||||||
int32 Group() const;
|
int32 Group() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BString fpath;
|
BString fpath;
|
||||||
int32 fgroup;
|
int32 fgroup;
|
||||||
|
|||||||
Reference in New Issue
Block a user