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