diff --git a/src/apps/resedit/App.cpp b/src/apps/resedit/App.cpp index a4f2f0401f..96f80ba1e2 100644 --- a/src/apps/resedit/App.cpp +++ b/src/apps/resedit/App.cpp @@ -1,9 +1,9 @@ /* - * Copyright (c) 2005-2006, Haiku, Inc. + * Copyright (c) 2005-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: - * DarkWyrm + * DarkWyrm */ #include "App.h" #include "ResWindow.h" @@ -19,25 +19,25 @@ main(void) App::App(void) - : BApplication("application/x-vnd.Haiku-ResEdit"), - fWindowCount(0) + : BApplication("application/x-vnd.Haiku-ResEdit") { fOpenPanel = new BFilePanel(); - fSavePanel = new BFilePanel(B_SAVE_PANEL); } App::~App(void) { delete fOpenPanel; - delete fSavePanel; } void App::ReadyToRun(void) { - if (fWindowCount < 1) + // CountWindows() needs to be used instead of fWindowCount because the registration + // message isn't processed in time. One of the windows belong to the BFilePanels and is + // counted in CountWindows(). + if (CountWindows() < 2) new ResWindow(BRect(50, 100, 600, 400)); } @@ -46,16 +46,6 @@ void App::MessageReceived(BMessage *msg) { switch(msg->what) { - case M_REGISTER_WINDOW: { - fWindowCount++; - break; - } - case M_UNREGISTER_WINDOW: { - fWindowCount--; - if (fWindowCount == 0) - PostMessage(B_QUIT_REQUESTED); - break; - } case M_SHOW_OPEN_PANEL: { // Don't do anything if it's already open if (fOpenPanel->IsShowing()) @@ -90,20 +80,3 @@ App::RefsReceived(BMessage *msg) while (msg->FindRef("refs", i++, &ref) == B_OK) new ResWindow(BRect(50, 100, 600, 400), &ref); } - - -bool -App::QuitRequested(void) -{ - for (int32 i = 0; i < CountWindows(); i++) { - BWindow *win = WindowAt(i); - if (fOpenPanel->Window() == win || fSavePanel->Window() == win) - continue; - - if (!win->QuitRequested()) - return false; - } - - return true; -} - diff --git a/src/apps/resedit/App.h b/src/apps/resedit/App.h index 52d5ead1cf..e6f4ade2a6 100644 --- a/src/apps/resedit/App.h +++ b/src/apps/resedit/App.h @@ -1,9 +1,9 @@ /* - * Copyright (c) 2005-2006, Haiku, Inc. + * Copyright (c) 2005-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: - * DarkWyrm + * DarkWyrm */ #ifndef APP_H #define APP_H @@ -12,8 +12,6 @@ #include enum { - M_REGISTER_WINDOW = 'regw', - M_UNREGISTER_WINDOW, M_SHOW_OPEN_PANEL, M_SHOW_SAVE_PANEL }; @@ -27,11 +25,9 @@ public: void ArgvReceived(int32 argc, char** argv); void RefsReceived(BMessage *msg); void ReadyToRun(void); - bool QuitRequested(void); private: - uint32 fWindowCount; - BFilePanel *fOpenPanel, *fSavePanel; + BFilePanel *fOpenPanel; }; #endif diff --git a/src/apps/resedit/Editor.h b/src/apps/resedit/Editor.h index 8019beffaf..1c8a05230a 100644 --- a/src/apps/resedit/Editor.h +++ b/src/apps/resedit/Editor.h @@ -1,9 +1,9 @@ /* - * Copyright (c) 2005-2006, Haiku, Inc. + * Copyright (c) 2005-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: - * DarkWyrm + * DarkWyrm */ #ifndef EDITOR_H #define EDITOR_H diff --git a/src/apps/resedit/ImageEditor.cpp b/src/apps/resedit/ImageEditor.cpp index 3bc910d627..fa18215ccf 100644 --- a/src/apps/resedit/ImageEditor.cpp +++ b/src/apps/resedit/ImageEditor.cpp @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2005-2010, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ #include "InternalEditors.h" #include "BitmapView.h" #include "ResourceData.h" @@ -80,6 +87,8 @@ ImageEditor::ImageEditor(const BRect &frame, ResourceData *data, BHandler *owner ResizeTo(MAX(fImageView->Frame().right, fNameBox->Frame().right) + 20, fImageView->Frame().bottom + fOK->Frame().Height() + 20); + + SetSizeLimits(Bounds().right,30000,Bounds().bottom,30000); } diff --git a/src/apps/resedit/InlineEditor.cpp b/src/apps/resedit/InlineEditor.cpp index 67ca638504..36c967ba5b 100644 --- a/src/apps/resedit/InlineEditor.cpp +++ b/src/apps/resedit/InlineEditor.cpp @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2005-2010, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ #include "InlineEditor.h" #include #include diff --git a/src/apps/resedit/InlineEditor.h b/src/apps/resedit/InlineEditor.h index 16359c02d5..041949fd74 100644 --- a/src/apps/resedit/InlineEditor.h +++ b/src/apps/resedit/InlineEditor.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2005-2010, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ #ifndef INLINE_EDITOR #define INLINE_EDITOR diff --git a/src/apps/resedit/InternalEditors.h b/src/apps/resedit/InternalEditors.h index add55f58a0..8c28069059 100644 --- a/src/apps/resedit/InternalEditors.h +++ b/src/apps/resedit/InternalEditors.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2005-2010, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ #ifndef INTERNALEDITORS_H #define INTERNALEDITORS_H diff --git a/src/apps/resedit/Jamfile b/src/apps/resedit/Jamfile index c0649b54e2..3af837049d 100644 --- a/src/apps/resedit/Jamfile +++ b/src/apps/resedit/Jamfile @@ -22,6 +22,7 @@ Application ResEdit : NumberEditors.cpp PreviewColumn.cpp ResFields.cpp + ResListView.cpp ResourceData.cpp ResourceRoster.cpp ResView.cpp diff --git a/src/apps/resedit/MiscEditors.cpp b/src/apps/resedit/MiscEditors.cpp index 162433b1da..81cadbfab5 100644 --- a/src/apps/resedit/MiscEditors.cpp +++ b/src/apps/resedit/MiscEditors.cpp @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2005-2010, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ #include "InternalEditors.h" #include "ResourceData.h" #include @@ -138,7 +145,7 @@ StringEditView::GetPreferredWidth(void) const be_plain_font->StringWidth("(attr) ") + 15; float namewidth = be_plain_font->StringWidth("Name: ") + be_plain_font->StringWidth(fNameBox->Text()) + 15; - return idwidth + namewidth + 30; + return idwidth + namewidth + 100; } diff --git a/src/apps/resedit/NumberEditors.cpp b/src/apps/resedit/NumberEditors.cpp index dfbb881772..9448135cf9 100644 --- a/src/apps/resedit/NumberEditors.cpp +++ b/src/apps/resedit/NumberEditors.cpp @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2005-2010, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ #include "InternalEditors.h" #include "ResourceData.h" #include diff --git a/src/apps/resedit/PreviewColumn.cpp b/src/apps/resedit/PreviewColumn.cpp index 8ef91682cf..874c0054c1 100644 --- a/src/apps/resedit/PreviewColumn.cpp +++ b/src/apps/resedit/PreviewColumn.cpp @@ -1,9 +1,9 @@ /* - * Copyright (c) 2005-2006, Haiku, Inc. + * Copyright (c) 2005-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: - * DarkWyrm + * DarkWyrm */ #include "PreviewColumn.h" #include "ResFields.h" diff --git a/src/apps/resedit/PreviewColumn.h b/src/apps/resedit/PreviewColumn.h index 9117f2e3d4..741a809c43 100644 --- a/src/apps/resedit/PreviewColumn.h +++ b/src/apps/resedit/PreviewColumn.h @@ -1,9 +1,9 @@ /* - * Copyright (c) 2005-2006, Haiku, Inc. + * Copyright (c) 2005-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: - * DarkWyrm + * DarkWyrm */ #ifndef PREVIEW_COLUMN_H #define PREVIEW_COLUMN_H diff --git a/src/apps/resedit/ResFields.cpp b/src/apps/resedit/ResFields.cpp index 26d3f6eccf..1c2f1ae817 100644 --- a/src/apps/resedit/ResFields.cpp +++ b/src/apps/resedit/ResFields.cpp @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2005-2010, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ #include "ResFields.h" #include "ResourceData.h" #include diff --git a/src/apps/resedit/ResFields.h b/src/apps/resedit/ResFields.h index 1f85a6fa98..f00ae40f24 100644 --- a/src/apps/resedit/ResFields.h +++ b/src/apps/resedit/ResFields.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2005-2010, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ #ifndef RESFIELDS_H #define RESFIELDS_H diff --git a/src/apps/resedit/ResView.cpp b/src/apps/resedit/ResView.cpp index 53e82ff431..9a01db9992 100644 --- a/src/apps/resedit/ResView.cpp +++ b/src/apps/resedit/ResView.cpp @@ -1,23 +1,27 @@ /* - * Copyright (c) 2005-2006, Haiku, Inc. + * Copyright (c) 2005-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: - * DarkWyrm + * DarkWyrm */ #include "ResView.h" #include +#include #include -#include +#include #include #include #include -#include +#include +#include +#include "ColumnTypes.h" #include "App.h" #include "ResourceData.h" #include "ResFields.h" +#include "ResListView.h" #include "ResWindow.h" #include "PreviewColumn.h" #include "Editor.h" @@ -32,6 +36,8 @@ enum { M_SAVE_FILE, M_SAVE_FILE_AS, M_QUIT, + M_SELECT_FILE, + M_DELETE_RESOURCE, M_EDIT_RESOURCE }; @@ -52,23 +58,16 @@ ResView::ResView(const BRect &frame, const char *name, const int32 &resize, sUntitled++; } - BMenu *menu = new BMenu("File"); - menu->AddItem(new BMenuItem("New" B_UTF8_ELLIPSIS, new BMessage(M_NEW_FILE), 'N')); - menu->AddSeparatorItem(); - menu->AddItem(new BMenuItem("Open" B_UTF8_ELLIPSIS, new BMessage(M_OPEN_FILE), 'O')); - menu->AddItem(new BMenuItem("Quit", new BMessage(M_QUIT), 'Q')); - BRect r(Bounds()); r.bottom = 16; fBar = new BMenuBar(r, "bar"); AddChild(fBar); - fBar->AddItem(menu); + BuildMenus(fBar); r = Bounds(); r.top = fBar->Frame().bottom + 4; - fListView = new BColumnListView(r, "gridview", B_FOLLOW_ALL, B_WILL_DRAW, - B_FANCY_BORDER); + fListView = new ResListView(r, "gridview", B_FOLLOW_ALL, B_WILL_DRAW, B_FANCY_BORDER); AddChild(fListView); rgb_color white = { 255,255,255,255 }; @@ -81,11 +80,14 @@ ResView::ResView(const BRect &frame, const char *name, const int32 &resize, fListView->AddColumn(new BStringColumn("Type",width,width,100,B_TRUNCATE_END),1); fListView->AddColumn(new BStringColumn("Name",150,50,300,B_TRUNCATE_END),2); fListView->AddColumn(new PreviewColumn("Data",150,50,300),3); + + // Editing is disabled for now fListView->SetInvocationMessage(new BMessage(M_EDIT_RESOURCE)); width = be_plain_font->StringWidth("1000 bytes") + 20; fListView->AddColumn(new BSizeColumn("Size",width,10,100),4); + fFilePanel = new BFilePanel(B_OPEN_PANEL); if (ref) OpenFile(*ref); } @@ -95,6 +97,7 @@ ResView::~ResView(void) { EmptyDataList(); delete fRef; + delete fFilePanel; } @@ -104,17 +107,13 @@ ResView::AttachedToWindow(void) for(int32 i = 0; i < fBar->CountItems(); i++) fBar->SubmenuAt(i)->SetTargetForItems(this); fListView->SetTarget(this); + fFilePanel->SetTarget(BMessenger(this)); } void ResView::MessageReceived(BMessage *msg) { - if (msg->WasDropped()) { - be_app->PostMessage(msg); - return; - } - switch (msg->what) { case M_NEW_FILE: { BRect r(100,100,400,400); @@ -132,6 +131,21 @@ ResView::MessageReceived(BMessage *msg) be_app->PostMessage(B_QUIT_REQUESTED); break; } + case B_REFS_RECEIVED: { + int32 i = 0; + entry_ref ref; + while (msg->FindRef("refs",i++,&ref) == B_OK) + AddResource(ref); + break; + } + case M_SELECT_FILE: { + fFilePanel->Show(); + break; + } + case M_DELETE_RESOURCE: { + DeleteSelectedResources(); + break; + } case M_EDIT_RESOURCE: { BRow *row = fListView->CurrentSelection(); TypeCodeField *field = (TypeCodeField*)row->GetField(1); @@ -164,7 +178,6 @@ void ResView::OpenFile(const entry_ref &ref) { // Add all the 133t resources and attributes of the file - BFile file(&ref, B_READ_ONLY); BResources resources; if (resources.SetTo(&file) != B_OK) @@ -174,19 +187,10 @@ ResView::OpenFile(const entry_ref &ref) resources.PreloadResourceType(); int32 index = 0; - BRow *row; + ResDataRow *row; ResourceData *resData = new ResourceData(); while (resData->SetFromResource(index, resources)) { - row = new BRow(); - row->SetField(new BStringField(resData->GetIDString()),0); - row->SetField(new TypeCodeField(resData->GetType(),resData),1); - row->SetField(new BStringField(resData->GetName()),2); - BField *field = gResRoster.MakeFieldForType(resData->GetType(), - resData->GetData(), - resData->GetLength()); - if (field) - row->SetField(field,3); - row->SetField(new BSizeField(resData->GetLength()),4); + row = new ResDataRow(resData); fListView->AddRow(row); fDataList.AddItem(resData); resData = new ResourceData(); @@ -201,16 +205,7 @@ ResView::OpenFile(const entry_ref &ref) resData = new ResourceData(); while (node.GetNextAttrName(attrName) == B_OK) { if (resData->SetFromAttribute(attrName, node)) { - row = new BRow(); - row->SetField(new BStringField(resData->GetIDString()),0); - row->SetField(new TypeCodeField(resData->GetType(),resData),1); - row->SetField(new BStringField(resData->GetName()),2); - BField *field = gResRoster.MakeFieldForType(resData->GetType(), - resData->GetData(), - resData->GetLength()); - if (field) - row->SetField(field,3); - row->SetField(new BSizeField(resData->GetLength()),4); + row = new ResDataRow(resData); fListView->AddRow(row); fDataList.AddItem(resData); resData = new ResourceData(); @@ -221,6 +216,25 @@ ResView::OpenFile(const entry_ref &ref) } +void +ResView::BuildMenus(BMenuBar *menuBar) +{ + BMenu *menu = new BMenu("File"); + menu->AddItem(new BMenuItem("New" B_UTF8_ELLIPSIS, new BMessage(M_NEW_FILE), 'N')); + menu->AddSeparatorItem(); + menu->AddItem(new BMenuItem("Open" B_UTF8_ELLIPSIS, new BMessage(M_OPEN_FILE), 'O')); + menuBar->AddItem(menu); + + menu = new BMenu("Resource"); + + menu->AddItem(new BMenuItem("Add" B_UTF8_ELLIPSIS, new BMessage(M_SELECT_FILE), 'F')); + menu->AddItem(new BMenuItem("Delete", new BMessage(M_DELETE_RESOURCE), 'D')); + + + menuBar->AddItem(menu); +} + + void ResView::EmptyDataList(void) { @@ -251,3 +265,98 @@ ResView::UpdateRow(BRow *row) BSizeField *sizeField = (BSizeField*)row->GetField(4); sizeField->SetSize(resData->GetLength()); } + + +void +ResView::AddResource(const entry_ref &ref) +{ + BFile file(&ref,B_READ_ONLY); + if (file.InitCheck() != B_OK) + return; + + BString mime; + file.ReadAttrString("BEOS:TYPE",&mime); + + if (mime == "application/x-be-resource") { + BMessage msg(B_REFS_RECEIVED); + msg.AddRef("refs",&ref); + be_app->PostMessage(&msg); + return; + } + + type_code fileType = 0; + + BTranslatorRoster *roster = BTranslatorRoster::Default(); + translator_info info; + if (roster->Identify(&file,NULL,&info,0,mime.String()) == B_OK) + fileType = info.type; + else + fileType = B_RAW_TYPE; + + int32 lastID = -1; + for (int32 i = 0; i < fDataList.CountItems(); i++) { + ResourceData *resData = (ResourceData*)fDataList.ItemAt(i); + if (resData->GetType() == fileType && resData->GetID() > lastID) + lastID = resData->GetID(); + } + + off_t fileSize; + file.GetSize(&fileSize); + + if (fileSize < 1) + return; + + char *fileData = (char *)malloc(fileSize); + file.Read(fileData,fileSize); + + ResourceData *resData = new ResourceData(fileType,lastID + 1, ref.name, + fileData,fileSize); + fDataList.AddItem(resData); + + ResDataRow *row = new ResDataRow(resData); + fListView->AddRow(row); + + fIsDirty = true; +} + + +void +ResView::DeleteSelectedResources(void) +{ + ResDataRow *selection = (ResDataRow*)fListView->CurrentSelection(); + + if (selection) + fIsDirty = true; + + while (selection) { + ResourceData *data = selection->GetData(); + fListView->RemoveRow(selection); + fDataList.RemoveItem(data); + delete data; + selection = (ResDataRow*)fListView->CurrentSelection(); + } +} + + +ResDataRow::ResDataRow(ResourceData *data) + : fResData(data) +{ + if (data) { + SetField(new BStringField(fResData->GetIDString()),0); + SetField(new TypeCodeField(fResData->GetType(),fResData),1); + SetField(new BStringField(fResData->GetName()),2); + BField *field = gResRoster.MakeFieldForType(fResData->GetType(), + fResData->GetData(), + fResData->GetLength()); + if (field) + SetField(field,3); + SetField(new BSizeField(fResData->GetLength()),4); + } +} + + +ResourceData * +ResDataRow::GetData(void) const +{ + return fResData; +} diff --git a/src/apps/resedit/ResView.h b/src/apps/resedit/ResView.h index e39978f5c7..175a6fcbe6 100644 --- a/src/apps/resedit/ResView.h +++ b/src/apps/resedit/ResView.h @@ -1,24 +1,27 @@ /* - * Copyright (c) 2005-2006, Haiku, Inc. + * Copyright (c) 2005-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: - * DarkWyrm + * DarkWyrm */ #ifndef RESVIEW_H #define RESVIEW_H -#include -#include #include -#include -#include +#include #include +#include +#include #include +#include +#include + #include "ResourceRoster.h" class BMenuBar; +class ResListView; class ResView : public BView { public: @@ -35,15 +38,31 @@ public: void OpenFile(const entry_ref &ref); private: + void BuildMenus(BMenuBar *menuBar); void EmptyDataList(void); void UpdateRow(BRow *row); + void HandleDrop(BMessage *msg); + void AddResource(const entry_ref &ref); + void DeleteSelectedResources(void); - BColumnListView *fListView; + ResListView *fListView; entry_ref *fRef; BString fFileName; BMenuBar *fBar; bool fIsDirty; BList fDataList; + BFilePanel *fFilePanel; +}; + +class ResDataRow : public BRow +{ +public: + ResDataRow(ResourceData *data); + + ResourceData * GetData(void) const; + +private: + ResourceData *fResData; }; extern ResourceRoster gResRoster; diff --git a/src/apps/resedit/ResWindow.cpp b/src/apps/resedit/ResWindow.cpp index ddd44ca6fa..4ea547a2a9 100644 --- a/src/apps/resedit/ResWindow.cpp +++ b/src/apps/resedit/ResWindow.cpp @@ -1,21 +1,23 @@ /* - * Copyright (c) 2005-2006, Haiku, Inc. + * Copyright (c) 2005-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: - * DarkWyrm + * DarkWyrm */ #include "ResWindow.h" #include "ResView.h" #include "App.h" +static int32 sWindowCount = 0; + ResWindow::ResWindow(const BRect &rect, const entry_ref *ref) : BWindow(rect,"", B_DOCUMENT_WINDOW, B_ASYNCHRONOUS_CONTROLS) { - be_app->PostMessage(M_REGISTER_WINDOW); + atomic_add(&sWindowCount,1); ResView *child = new ResView(Bounds(), "resview", B_FOLLOW_ALL, - B_WILL_DRAW, ref); + B_WILL_DRAW, ref); AddChild(child); SetTitle(child->Filename()); @@ -32,7 +34,11 @@ ResWindow::~ResWindow(void) bool ResWindow::QuitRequested(void) { - be_app->PostMessage(M_UNREGISTER_WINDOW); + atomic_add(&sWindowCount,-1); + + if (sWindowCount == 0) + be_app->PostMessage(B_QUIT_REQUESTED); + // be_app->PostMessage(M_UNREGISTER_WINDOW); return true; } diff --git a/src/apps/resedit/ResWindow.h b/src/apps/resedit/ResWindow.h index d6e01ab9c4..cf9cbc9cbc 100644 --- a/src/apps/resedit/ResWindow.h +++ b/src/apps/resedit/ResWindow.h @@ -1,9 +1,9 @@ /* - * Copyright (c) 2005-2008, Haiku, Inc. + * Copyright (c) 2005-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: - * DarkWyrm + * DarkWyrm */ #ifndef RESWIN_H #define RESWIN_H diff --git a/src/apps/resedit/ResourceData.cpp b/src/apps/resedit/ResourceData.cpp index 1d1f0d3703..3f01887f0f 100644 --- a/src/apps/resedit/ResourceData.cpp +++ b/src/apps/resedit/ResourceData.cpp @@ -1,9 +1,9 @@ /* - * Copyright (c) 2005-2006, Haiku, Inc. + * Copyright (c) 2005-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: - * DarkWyrm + * DarkWyrm */ #include "ResourceData.h" #include "ResFields.h" diff --git a/src/apps/resedit/ResourceData.h b/src/apps/resedit/ResourceData.h index bbbb28467f..ae86ee2c3d 100644 --- a/src/apps/resedit/ResourceData.h +++ b/src/apps/resedit/ResourceData.h @@ -1,9 +1,9 @@ /* - * Copyright (c) 2005-2006, Haiku, Inc. + * Copyright (c) 2005-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: - * DarkWyrm + * DarkWyrm */ #ifndef RESOURCE_DATA_H #define RESOURCE_DATA_H diff --git a/src/apps/resedit/ResourceRoster.cpp b/src/apps/resedit/ResourceRoster.cpp index 55259275f3..dc92b93bb6 100644 --- a/src/apps/resedit/ResourceRoster.cpp +++ b/src/apps/resedit/ResourceRoster.cpp @@ -1,9 +1,9 @@ /* - * Copyright (c) 2005-2006, Haiku, Inc. + * Copyright (c) 2005-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: - * DarkWyrm + * DarkWyrm */ #include "ResourceRoster.h" #include @@ -152,7 +152,7 @@ ResourceRoster::SpawnEditor(ResourceData *data, BHandler *handler) // temporary code until editors are done switch (data->GetType()) { case B_MIME_STRING_TYPE: { - StringEditor *strEd = new StringEditor(BRect(100,100,300,200), + StringEditor *strEd = new StringEditor(BRect(100,100,400,200), data, handler); strEd->Show(); break; diff --git a/src/apps/resedit/ResourceRoster.h b/src/apps/resedit/ResourceRoster.h index b225a10de7..01fe8c18a1 100644 --- a/src/apps/resedit/ResourceRoster.h +++ b/src/apps/resedit/ResourceRoster.h @@ -1,16 +1,16 @@ /* - * Copyright (c) 2005-2006, Haiku, Inc. + * Copyright (c) 2005-2010, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: - * DarkWyrm + * DarkWyrm */ #ifndef RESROSTER_H #define RESROSTER_H #include -#include -#include +#include "ColumnTypes.h" +#include "ColumnListView.h" class Editor; class ResourceData; @@ -18,16 +18,16 @@ class ResourceData; class ResourceRoster { public: - ResourceRoster(void); - ~ResourceRoster(void); - BField * MakeFieldForType(const int32 &type, const char *data, - const size_t &length); - void SpawnEditor(ResourceData *data, BHandler *handler); - -private: - void LoadEditors(void); + ResourceRoster(void); + ~ResourceRoster(void); + BField * MakeFieldForType(const int32 &type, const char *data, + const size_t &length); + void SpawnEditor(ResourceData *data, BHandler *handler); - BList fList; +private: + void LoadEditors(void); + + BList fList; }; typedef Editor* create_editor(void);