Add private MIME DB classes to libbe_build
* This pulls in some more stuff, like libicon and agg which are also included in libbe_build, now. * Update a few libbe_build classes and headers needed to get things building. * This likely breaks the <build>mimeset build on Haiku.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
#include <../os/interface/Gradient.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../os/interface/IconUtils.h>
|
||||
@@ -1,128 +1 @@
|
||||
//----------------------------------------------------------------------
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//---------------------------------------------------------------------
|
||||
/*!
|
||||
\file AppFileInfo.h
|
||||
BAppFileInfo and related structures' interface declarations.
|
||||
*/
|
||||
#ifndef _APP_FILE_INFO_H
|
||||
#define _APP_FILE_INFO_H
|
||||
|
||||
#include <NodeInfo.h>
|
||||
|
||||
class BBitmap;
|
||||
class BFile;
|
||||
class BMessage;
|
||||
class BResources;
|
||||
|
||||
struct version_info {
|
||||
uint32 major;
|
||||
uint32 middle;
|
||||
uint32 minor;
|
||||
uint32 variety;
|
||||
uint32 internal;
|
||||
char short_info[64];
|
||||
char long_info[256];
|
||||
};
|
||||
|
||||
enum info_location {
|
||||
B_USE_ATTRIBUTES = 0x1,
|
||||
B_USE_RESOURCES = 0x2,
|
||||
B_USE_BOTH_LOCATIONS = 0x3 // == B_USE_ATTRIBUTES | B_USE_RESOURCES
|
||||
};
|
||||
|
||||
enum version_kind {
|
||||
B_APP_VERSION_KIND,
|
||||
B_SYSTEM_VERSION_KIND
|
||||
};
|
||||
|
||||
/*! \brief Executable meta information handling.
|
||||
The BAppFileInfo class provides access to meta data that can be associated
|
||||
with executables, libraries and add-ons.
|
||||
|
||||
\author <a href='[email protected]'>Ingo Weinhold</a>
|
||||
\version 0.0.0
|
||||
*/
|
||||
class BAppFileInfo: public BNodeInfo {
|
||||
public:
|
||||
BAppFileInfo();
|
||||
BAppFileInfo(BFile *file);
|
||||
virtual ~BAppFileInfo();
|
||||
|
||||
status_t SetTo(BFile *file);
|
||||
|
||||
virtual status_t GetType(char *type) const;
|
||||
virtual status_t SetType(const char *type);
|
||||
|
||||
status_t GetSignature(char *signature) const;
|
||||
status_t SetSignature(const char *signature);
|
||||
|
||||
status_t GetCatalogEntry(char *catalogEntry) const;
|
||||
status_t SetCatalogEntry(const char *catalogEntry);
|
||||
|
||||
status_t GetAppFlags(uint32 *flags) const;
|
||||
status_t SetAppFlags(uint32 flags);
|
||||
|
||||
status_t GetSupportedTypes(BMessage *types) const;
|
||||
status_t SetSupportedTypes(const BMessage *types, bool syncAll);
|
||||
status_t SetSupportedTypes(const BMessage *types);
|
||||
bool IsSupportedType(const char *type) const;
|
||||
bool Supports(BMimeType *type) const;
|
||||
|
||||
virtual status_t GetIcon(BBitmap *icon, icon_size which) const;
|
||||
virtual status_t SetIcon(const BBitmap *icon, icon_size which);
|
||||
|
||||
status_t GetVersionInfo(version_info *info, version_kind kind) const;
|
||||
status_t SetVersionInfo(const version_info *info, version_kind kind);
|
||||
|
||||
status_t GetIconForType(const char *type, BBitmap *icon,
|
||||
icon_size which) const;
|
||||
status_t SetIconForType(const char *type, const BBitmap *icon,
|
||||
icon_size which);
|
||||
|
||||
void SetInfoLocation(info_location location);
|
||||
bool IsUsingAttributes() const;
|
||||
bool IsUsingResources() const;
|
||||
|
||||
private:
|
||||
// uncomment when needed
|
||||
// friend status_t _update_mime_info_(const char *, int32);
|
||||
// friend status_t _real_update_app_(BAppFileInfo *, const char *, bool);
|
||||
// friend status_t _query_for_app_(BMimeType *, const char *, entry_ref *,
|
||||
// version_info *);
|
||||
// friend class BRoster;
|
||||
|
||||
virtual void _ReservedAppFileInfo1();
|
||||
virtual void _ReservedAppFileInfo2();
|
||||
virtual void _ReservedAppFileInfo3();
|
||||
|
||||
// uncomment when needed
|
||||
// static status_t SetSupTypesForAll(BMimeType *, const BMessage *);
|
||||
|
||||
BAppFileInfo &operator=(const BAppFileInfo &);
|
||||
BAppFileInfo(const BAppFileInfo &);
|
||||
|
||||
// uncomment when needed
|
||||
// status_t _SetSupportedTypes(const BMessage *types);
|
||||
// status_t UpdateFromRsrc();
|
||||
// status_t RealUpdateRsrcToAttr();
|
||||
// status_t UpdateMetaMime(const char *path, bool force,
|
||||
// uint32 *changesMask) const;
|
||||
// bool IsApp();
|
||||
status_t GetMetaMime(BMimeType *meta) const;
|
||||
|
||||
status_t _ReadData(const char *name, int32 id, type_code type,
|
||||
void *buffer, size_t bufferSize,
|
||||
size_t &bytesRead, void **allocatedBuffer = NULL) const;
|
||||
status_t _WriteData(const char *name, int32 id, type_code type,
|
||||
const void *buffer, size_t bufferSize,
|
||||
bool findID = false);
|
||||
status_t _RemoveData(const char *name, type_code type);
|
||||
|
||||
BResources *fResources;
|
||||
info_location fWhere;
|
||||
uint32 _reserved[2];
|
||||
};
|
||||
|
||||
#endif // _APP_FILE_INFO_H
|
||||
#include <../os/storage/AppFileInfo.h>
|
||||
|
||||
@@ -51,6 +51,8 @@ public:
|
||||
status_t InitCheck() const;
|
||||
bool Exists() const;
|
||||
|
||||
const char* Name() const;
|
||||
|
||||
virtual status_t GetStat(struct stat *st) const;
|
||||
|
||||
status_t SetTo(const BDirectory *dir, const char *path,
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include <../private/interface/Palette.h>
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright 2013, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Ingo Weinhold <[email protected]>
|
||||
*/
|
||||
#ifndef _MERGED_DIRECTORY_H
|
||||
#define _MERGED_DIRECTORY_H
|
||||
|
||||
|
||||
#include <EntryList.h>
|
||||
#include <ObjectList.h>
|
||||
|
||||
|
||||
class BDirectory;
|
||||
|
||||
|
||||
class BMergedDirectory : public BEntryList {
|
||||
public:
|
||||
// policy how to handle equally named entries in different
|
||||
// directories
|
||||
enum BPolicy {
|
||||
B_ALLOW_DUPLICATES,
|
||||
B_ALWAYS_FIRST,
|
||||
B_COMPARE
|
||||
};
|
||||
|
||||
public:
|
||||
BMergedDirectory(
|
||||
BPolicy policy = B_ALWAYS_FIRST);
|
||||
virtual ~BMergedDirectory();
|
||||
|
||||
status_t Init();
|
||||
|
||||
BPolicy Policy() const;
|
||||
void SetPolicy(BPolicy policy);
|
||||
|
||||
status_t AddDirectory(BDirectory* directory);
|
||||
status_t AddDirectory(const char* path);
|
||||
|
||||
virtual status_t GetNextEntry(BEntry* entry,
|
||||
bool traverse = false);
|
||||
virtual status_t GetNextRef(entry_ref* ref);
|
||||
virtual int32 GetNextDirents(struct dirent* direntBuffer,
|
||||
size_t bufferSize,
|
||||
int32 maxEntries = INT_MAX);
|
||||
virtual status_t Rewind();
|
||||
virtual int32 CountEntries();
|
||||
|
||||
protected:
|
||||
virtual bool ShallPreferFirstEntry(const entry_ref& entry1,
|
||||
int32 index1, const entry_ref& entry2,
|
||||
int32 index2);
|
||||
// always invoked with index1 < index2
|
||||
|
||||
private:
|
||||
typedef BObjectList<BDirectory> DirectoryList;
|
||||
struct EntryNameSet;
|
||||
|
||||
private:
|
||||
bool _IsBestEntry(const char* name);
|
||||
|
||||
private:
|
||||
DirectoryList fDirectories;
|
||||
BPolicy fPolicy;
|
||||
int32 fDirectoryIndex;
|
||||
EntryNameSet* fVisitedEntries;
|
||||
};
|
||||
|
||||
|
||||
#endif // _MERGED_DIRECTORY_H
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/mime/AppMetaMimeCreator.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/mime/AssociatedTypes.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/mime/Database.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/mime/DatabaseDirectory.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/mime/DatabaseLocation.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/mime/InstalledTypes.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/mime/MimeSniffer.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/mime/SnifferRules.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/mime/Supertype.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/mime/SupportingApps.h>
|
||||
@@ -1,46 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//---------------------------------------------------------------------
|
||||
/*!
|
||||
\file database_access.h
|
||||
Mime database atomic read functions and miscellany declarations
|
||||
*/
|
||||
|
||||
#ifndef _MIME_DATABASE_ACCESS_H
|
||||
#define _MIME_DATABASE_ACCESS_H
|
||||
|
||||
#include <Mime.h>
|
||||
|
||||
class BNode;
|
||||
class BBitmap;
|
||||
class BMessage;
|
||||
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
namespace Mime {
|
||||
|
||||
// Get() functions
|
||||
status_t get_app_hint(const char *type, entry_ref *ref);
|
||||
status_t get_attr_info(const char *type, BMessage *info);
|
||||
status_t get_short_description(const char *type, char *description);
|
||||
status_t get_long_description(const char *type, char *description);
|
||||
status_t get_file_extensions(const char *type, BMessage *extensions);
|
||||
status_t get_icon(const char *type, BBitmap *icon, icon_size size);
|
||||
status_t get_icon_for_type(const char *type, const char *fileType, BBitmap *icon,
|
||||
icon_size which);
|
||||
status_t get_preferred_app(const char *type, char *signature, app_verb verb);
|
||||
status_t get_sniffer_rule(const char *type, BString *result);
|
||||
status_t get_supported_types(const char *type, BMessage *types);
|
||||
|
||||
bool is_installed(const char *type);
|
||||
|
||||
// Called by BMimeType to get properly formatted icon data ready
|
||||
// to be shipped off to SetIcon*() and written to the database
|
||||
status_t get_icon_data(const BBitmap *icon, icon_size size, void **data, int32 *dataSize);
|
||||
|
||||
} // namespace Mime
|
||||
} // namespace Storage
|
||||
} // namespace BPrivate
|
||||
|
||||
#endif // _MIME_DATABASE_H
|
||||
@@ -1,97 +1 @@
|
||||
//----------------------------------------------------------------------
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//---------------------------------------------------------------------
|
||||
/*!
|
||||
\file database_support.h
|
||||
Private mime database function and constant declarations
|
||||
*/
|
||||
|
||||
#ifndef _MIME_DATABASE_SUPPORT_H
|
||||
#define _MIME_DATABASE_SUPPORT_H
|
||||
|
||||
#include <StorageDefs.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
class BNode;
|
||||
class BMessage;
|
||||
|
||||
namespace BPrivate {
|
||||
namespace Storage {
|
||||
namespace Mime {
|
||||
|
||||
// Database directory
|
||||
extern const std::string kDatabaseDir;
|
||||
extern const std::string kApplicationDatabaseDir;
|
||||
|
||||
// Attribute Prefixes
|
||||
extern const char *kMiniIconAttrPrefix;
|
||||
extern const char *kLargeIconAttrPrefix;
|
||||
|
||||
// Attribute names
|
||||
extern const char *kFileTypeAttr;
|
||||
extern const char *kTypeAttr;
|
||||
extern const char *kAttrInfoAttr;
|
||||
extern const char *kAppHintAttr;
|
||||
extern const char *kShortDescriptionAttr;
|
||||
extern const char *kLongDescriptionAttr;
|
||||
extern const char *kFileExtensionsAttr;
|
||||
extern const char *kMiniIconAttr;
|
||||
extern const char *kLargeIconAttr;
|
||||
extern const char *kPreferredAppAttr;
|
||||
extern const char *kSnifferRuleAttr;
|
||||
extern const char *kSupportedTypesAttr;
|
||||
|
||||
// Attribute Datatypes
|
||||
extern const int32 kFileTypeType;
|
||||
extern const int32 kTypeType;
|
||||
extern const int32 kAppHintType;
|
||||
extern const int32 kAttrInfoType;
|
||||
extern const int32 kShortDescriptionType;
|
||||
extern const int32 kLongDescriptionType;
|
||||
extern const int32 kFileExtensionsType;
|
||||
extern const int32 kMiniIconType;
|
||||
extern const int32 kLargeIconType;
|
||||
extern const int32 kPreferredAppType;
|
||||
extern const int32 kSnifferRuleType;
|
||||
extern const int32 kSupportedTypesType;
|
||||
|
||||
// Message fields
|
||||
extern const char *kApplicationsField;
|
||||
extern const char *kExtensionsField;
|
||||
extern const char *kSupertypesField;
|
||||
extern const char *kSupportingAppsSubCountField;
|
||||
extern const char *kSupportingAppsSuperCountField;
|
||||
extern const char *kTypesField;
|
||||
|
||||
// Mime types
|
||||
extern const char *kGenericFileType;
|
||||
extern const char *kDirectoryType;
|
||||
extern const char *kSymlinkType;
|
||||
extern const char *kMetaMimeType;
|
||||
|
||||
// Error codes (to be used only by BPrivate::Storage::Mime members)
|
||||
extern const status_t kMimeGuessFailureError;
|
||||
|
||||
std::string type_to_filename(const char *type);
|
||||
|
||||
status_t open_type(const char *type, BNode *result);
|
||||
status_t open_or_create_type(const char *type, BNode *result, bool *didCreate);
|
||||
|
||||
ssize_t read_mime_attr(const char *type, const char *attr, void *data,
|
||||
size_t len, type_code datatype);
|
||||
status_t read_mime_attr_message(const char *type, const char *attr, BMessage *msg);
|
||||
status_t read_mime_attr_string(const char *type, const char *attr, BString *str);
|
||||
status_t write_mime_attr(const char *type, const char *attr, const void *data,
|
||||
size_t len, type_code datatype, bool *didCreate);
|
||||
status_t write_mime_attr_message(const char *type, const char *attr,
|
||||
const BMessage *msg, bool *didCreate);
|
||||
|
||||
status_t delete_attribute(const char *type, const char *attr);
|
||||
|
||||
} // namespace Mime
|
||||
} // namespace Storage
|
||||
} // namespace BPrivate
|
||||
|
||||
#endif // _MIME_DATABASE_SUPPORT_H
|
||||
#include <../../../private/storage/mime/database_support.h>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/sniffer/CharStream.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/sniffer/DisjList.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/sniffer/Err.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/sniffer/Parser.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/sniffer/Pattern.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/sniffer/PatternList.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/sniffer/RPattern.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/sniffer/RPatternList.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/sniffer/Range.h>
|
||||
@@ -0,0 +1 @@
|
||||
#include <../../../private/storage/sniffer/Rule.h>
|
||||
Reference in New Issue
Block a user