Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40985 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -15,9 +15,11 @@
|
|||||||
|
|
||||||
#include "DataTranslationsSettings.h"
|
#include "DataTranslationsSettings.h"
|
||||||
|
|
||||||
|
|
||||||
class BDirectory;
|
class BDirectory;
|
||||||
class BEntry;
|
class BEntry;
|
||||||
|
|
||||||
|
|
||||||
class DataTranslationsApplication : public BApplication {
|
class DataTranslationsApplication : public BApplication {
|
||||||
public:
|
public:
|
||||||
DataTranslationsApplication();
|
DataTranslationsApplication();
|
||||||
@@ -40,4 +42,5 @@ private:
|
|||||||
DataTranslationsSettings fSettings;
|
DataTranslationsSettings fSettings;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // DATA_TRANSLATIONS_H
|
#endif // DATA_TRANSLATIONS_H
|
||||||
|
|||||||
@@ -10,14 +10,14 @@
|
|||||||
|
|
||||||
#include "DataTranslationsSettings.h"
|
#include "DataTranslationsSettings.h"
|
||||||
|
|
||||||
#include <Application.h>
|
|
||||||
#include <FindDirectory.h>
|
|
||||||
#include <File.h>
|
|
||||||
#include <Path.h>
|
|
||||||
#include <Message.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <Application.h>
|
||||||
|
#include <File.h>
|
||||||
|
#include <FindDirectory.h>
|
||||||
|
#include <Message.h>
|
||||||
|
#include <Path.h>
|
||||||
|
|
||||||
|
|
||||||
DataTranslationsSettings::DataTranslationsSettings()
|
DataTranslationsSettings::DataTranslationsSettings()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,4 +24,5 @@ class DataTranslationsSettings {
|
|||||||
BPoint fCorner;
|
BPoint fCorner;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // DATA_TRANSLATIONS_SETTINGS_H
|
#endif // DATA_TRANSLATIONS_SETTINGS_H
|
||||||
|
|||||||
@@ -10,10 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "DataTranslations.h"
|
|
||||||
#include "DataTranslationsWindow.h"
|
#include "DataTranslationsWindow.h"
|
||||||
#include "IconView.h"
|
|
||||||
#include "TranslatorListView.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@@ -36,6 +33,10 @@
|
|||||||
#include <TranslationDefs.h>
|
#include <TranslationDefs.h>
|
||||||
#include <TranslatorRoster.h>
|
#include <TranslatorRoster.h>
|
||||||
|
|
||||||
|
#include "DataTranslations.h"
|
||||||
|
#include "IconView.h"
|
||||||
|
#include "TranslatorListView.h"
|
||||||
|
|
||||||
|
|
||||||
#undef B_TRANSLATE_CONTEXT
|
#undef B_TRANSLATE_CONTEXT
|
||||||
#define B_TRANSLATE_CONTEXT "DataTranslations"
|
#define B_TRANSLATE_CONTEXT "DataTranslations"
|
||||||
@@ -90,7 +91,8 @@ DataTranslationsWindow::_PopulateListView()
|
|||||||
for (int32 i = 0; i < numTranslators; i++) {
|
for (int32 i = 0; i < numTranslators; i++) {
|
||||||
// Getting the first three Infos: Name, Info & Version
|
// Getting the first three Infos: Name, Info & Version
|
||||||
int32 version;
|
int32 version;
|
||||||
const char *name, *info;
|
const char* name;
|
||||||
|
const char* info;
|
||||||
roster->GetTranslatorInfo(translators[i], &name, &info, &version);
|
roster->GetTranslatorInfo(translators[i], &name, &info, &version);
|
||||||
fTranslatorListView->AddItem(new TranslatorItem(translators[i], name));
|
fTranslatorListView->AddItem(new TranslatorItem(translators[i], name));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,9 +11,10 @@
|
|||||||
#define DATA_TRANSLATIONS_WINDOW_H
|
#define DATA_TRANSLATIONS_WINDOW_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <Window.h>
|
||||||
|
|
||||||
#include "IconView.h"
|
#include "IconView.h"
|
||||||
|
|
||||||
#include <Window.h>
|
|
||||||
|
|
||||||
class BBox;
|
class BBox;
|
||||||
class BStringView;
|
class BStringView;
|
||||||
@@ -32,8 +33,8 @@ class DataTranslationsWindow : public BWindow {
|
|||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
status_t _GetTranslatorInfo(int32 id, const char *&name, const char *&info,
|
status_t _GetTranslatorInfo(int32 id, const char*& name,
|
||||||
int32 &version, BPath &path);
|
const char*& info, int32& version, BPath& path);
|
||||||
void _ShowInfoAlert(int32 id);
|
void _ShowInfoAlert(int32 id);
|
||||||
status_t _ShowConfigView(int32 id);
|
status_t _ShowConfigView(int32 id);
|
||||||
status_t _PopulateListView();
|
status_t _PopulateListView();
|
||||||
@@ -42,14 +43,9 @@ class DataTranslationsWindow : public BWindow {
|
|||||||
TranslatorListView* fTranslatorListView;
|
TranslatorListView* fTranslatorListView;
|
||||||
|
|
||||||
BBox* fRightBox;
|
BBox* fRightBox;
|
||||||
// Box hosting fConfigView, fIconView,
|
|
||||||
// fTranNameView and the Info button
|
|
||||||
|
|
||||||
BView* fConfigView;
|
BView* fConfigView;
|
||||||
// the translator config view
|
|
||||||
|
|
||||||
IconView* fIconView;
|
IconView* fIconView;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DATA_TRANSLATIONS_WINDOW_H
|
|
||||||
|
|
||||||
|
#endif // DATA_TRANSLATIONS_WINDOW_H
|
||||||
|
|||||||
@@ -1,35 +1,25 @@
|
|||||||
/*****************************************************************************/
|
|
||||||
// IconView
|
|
||||||
// IconView.cpp
|
|
||||||
// Author: Michael Wilber
|
// Author: Michael Wilber
|
||||||
//
|
|
||||||
//
|
|
||||||
// This BView based object displays an icon
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Copyright (C) Haiku, uses the MIT license
|
// Copyright (C) Haiku, uses the MIT license
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
|
#include "IconView.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "IconView.h"
|
|
||||||
|
|
||||||
IconView::IconView(const BRect &frame, const char *name,
|
#include <Entry.h>
|
||||||
uint32 resize, uint32 flags)
|
#include <Node.h>
|
||||||
: BView(frame, name, resize, flags)
|
#include <NodeInfo.h>
|
||||||
|
|
||||||
|
|
||||||
|
IconView::IconView(const BRect& frame, const char* name, uint32 resize,
|
||||||
|
uint32 flags)
|
||||||
|
:
|
||||||
|
BView(frame, name, resize, flags),
|
||||||
|
fIconBitmap(new BBitmap(BRect(B_LARGE_ICON), B_RGBA32)),
|
||||||
|
fDrawIcon(false)
|
||||||
{
|
{
|
||||||
fDrawIcon = false;
|
|
||||||
|
|
||||||
SetDrawingMode(B_OP_OVER);
|
|
||||||
// to preserve transparent areas of the icon
|
|
||||||
|
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
#if __HAIKU__
|
|
||||||
fIconBitmap = new BBitmap(BRect(0, 0, B_LARGE_ICON - 1, B_LARGE_ICON - 1), B_RGBA32);
|
|
||||||
#else
|
|
||||||
fIconBitmap = new BBitmap(BRect(0, 0, B_LARGE_ICON - 1, B_LARGE_ICON - 1), B_CMAP8);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IconView::~IconView()
|
IconView::~IconView()
|
||||||
@@ -69,12 +59,9 @@ IconView::DrawIcon(bool draw)
|
|||||||
void
|
void
|
||||||
IconView::Draw(BRect area)
|
IconView::Draw(BRect area)
|
||||||
{
|
{
|
||||||
#if __HAIKU__
|
|
||||||
SetDrawingMode(B_OP_ALPHA);
|
SetDrawingMode(B_OP_ALPHA);
|
||||||
SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
|
SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY);
|
||||||
#else
|
|
||||||
SetDrawingMode(B_OP_OVER);
|
|
||||||
#endif
|
|
||||||
if (fDrawIcon)
|
if (fDrawIcon)
|
||||||
DrawBitmap(fIconBitmap);
|
DrawBitmap(fIconBitmap);
|
||||||
|
|
||||||
|
|||||||
@@ -1,40 +1,27 @@
|
|||||||
/*****************************************************************************/
|
|
||||||
// IconView
|
|
||||||
// IconView.h
|
|
||||||
// Author: Michael Wilber
|
// Author: Michael Wilber
|
||||||
//
|
|
||||||
// This BView based object displays an icon
|
|
||||||
//
|
|
||||||
// Copyright (C) Haiku, uses the MIT license
|
// Copyright (C) Haiku, uses the MIT license
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef ICONVIEW_H
|
#ifndef ICONVIEW_H
|
||||||
#define ICONVIEW_H
|
#define ICONVIEW_H
|
||||||
|
|
||||||
#include <View.h>
|
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <Entry.h>
|
#include <View.h>
|
||||||
#include <Node.h>
|
|
||||||
#include <NodeInfo.h>
|
|
||||||
|
|
||||||
class IconView : public BView {
|
class IconView : public BView {
|
||||||
public:
|
public:
|
||||||
IconView(const BRect &frame, const char *name, uint32 resize, uint32 flags);
|
IconView(const BRect& frame, const char* name,
|
||||||
// sets up the view
|
uint32 resize, uint32 flags);
|
||||||
~IconView();
|
~IconView();
|
||||||
|
virtual void Draw(BRect area);
|
||||||
|
|
||||||
bool DrawIcon(bool draw);
|
bool DrawIcon(bool draw);
|
||||||
|
|
||||||
bool SetIcon(const BPath& path);
|
bool SetIcon(const BPath& path);
|
||||||
|
|
||||||
virtual void Draw(BRect area);
|
|
||||||
// draws the icon
|
|
||||||
private:
|
private:
|
||||||
BBitmap* fIconBitmap;
|
BBitmap* fIconBitmap;
|
||||||
// the icon
|
|
||||||
bool fDrawIcon;
|
bool fDrawIcon;
|
||||||
// whether or not the icon is drawn
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // #ifndef ICONVIEW_H
|
#endif // #ifndef ICONVIEW_H
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ class TranslatorItem : public BStringItem {
|
|||||||
translator_id fID;
|
translator_id fID;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class TranslatorListView : public BListView {
|
class TranslatorListView : public BListView {
|
||||||
public:
|
public:
|
||||||
TranslatorListView(const char* name,
|
TranslatorListView(const char* name,
|
||||||
@@ -40,4 +41,5 @@ class TranslatorListView : public BListView {
|
|||||||
void SortItems();
|
void SortItems();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // TRANSLATOR_LIST_VIEW_H
|
#endif // TRANSLATOR_LIST_VIEW_H
|
||||||
|
|||||||
Reference in New Issue
Block a user