some header files to be R5 compatible

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1617 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2002-10-23 13:54:44 +00:00
parent 16fe4511e7
commit d734a8ce5a
39 changed files with 4652 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
/***************************************************************************
//
// File: Alias.h
//
// Description: path->alias->path functions
//
// Copyright 1992-98, Be Incorporated, All Rights Reserved.
//
***************************************************************************/
#ifndef _ALIAS_H
#define _ALIAS_H
#ifndef _BE_BUILD_H
#include <BeBuild.h>
#endif
#include <SupportDefs.h>
class BPath;
class BDataIO;
_IMPEXP_BE status_t resolve_link(const char *path, BPath *result,
bool block = false);
_IMPEXP_BE status_t write_alias(const char *path, BDataIO *s,
size_t *len = NULL);
_IMPEXP_BE status_t write_alias(const char *path, void *buf, size_t *len);
_IMPEXP_BE status_t read_alias(BDataIO *s, BPath *result, size_t *len = NULL,
bool block = false);
_IMPEXP_BE status_t read_alias(const void *buf, BPath *result, size_t *len,
bool block = false);
#endif
+151
View File
@@ -0,0 +1,151 @@
/*******************************************************************************
/
/ File: FilePanel.h
/
/ Description: BFilePanel and BRefFilter classes, and
/ run_open_panel()/run_save_panel functions.
/
/ Copyright 1993-98, Be Incorporated, All Rights Reserved.
/
*******************************************************************************/
#ifndef _FILE_PANEL_H
#define _FILE_PANEL_H
#ifndef _BE_BUILD_H
#include <BeBuild.h>
#endif
#include <sys/stat.h>
#include <Entry.h>
#include <Directory.h>
#include <Node.h>
/*- Old fashioned, one-shot, heavily-defaulted panel functions. -*/
extern _IMPEXP_TRACKER void run_open_panel();
extern _IMPEXP_TRACKER void run_save_panel();
/*---BRefFilter--------------------------------------------------*/
/* BRefFilter is used by BFilePanel. Every time the user selects
* an item in a file panel, the Filter() func is sent to the
* panel's BRefFilter object. Filter()'s return value determines
* whether the item is admitted into the panel's list of
* displayed items. Optional.
*/
class BRefFilter {
public:
virtual bool Filter(const entry_ref *, BNode *, struct stat *,
const char *mimetype) = 0;
};
/*---File Panel constants etc------------------------------------*/
enum file_panel_mode {
B_OPEN_PANEL,
B_SAVE_PANEL
};
enum file_panel_button {
B_CANCEL_BUTTON,
B_DEFAULT_BUTTON
};
class BWindow;
class BMessenger;
class BMessage;
/*---------------------------------------------------------------*/
/*----BFilePanel-------------------------------------------------*/
/* Most of the contructor parameters can also be set through individual
* funcs. But these can't:
*
* file_panel_mode mode
* uint32 node_flavors
* bool modal
*/
class BFilePanel {
public:
BFilePanel(file_panel_mode mode = B_OPEN_PANEL,
BMessenger *target = 0,
const entry_ref *start_directory = 0,
uint32 node_flavors = 0,
bool allow_multiple_selection = true,
BMessage *message = 0,
BRefFilter * = 0,
bool modal = false,
bool hide_when_done = true);
virtual ~BFilePanel();
void Show();
void Hide();
bool IsShowing() const;
virtual void WasHidden();
virtual void SelectionChanged();
virtual void SendMessage(const BMessenger*, BMessage*);
BWindow* Window() const;
BMessenger Messenger() const;
BRefFilter* RefFilter() const;
void GetPanelDirectory(entry_ref *) const;
file_panel_mode PanelMode() const;
void SetTarget(BMessenger);
void SetMessage(BMessage *msg);
void SetRefFilter(BRefFilter* filter);
void SetSaveText(const char* text);
void SetButtonLabel(file_panel_button, const char *label);
void SetPanelDirectory(const BEntry *new_directory);
void SetPanelDirectory(const BDirectory *new_directory);
void SetPanelDirectory(const entry_ref *new_directory);
void SetPanelDirectory(const char *new_directory);
void SetHideWhenDone(bool);
bool HidesWhenDone(void) const;
void Refresh();
void Rewind();
status_t GetNextSelectedRef(entry_ref*);
private:
#if !_PR3_COMPATIBLE_
virtual void _ReservedFilePanel1();
virtual void _ReservedFilePanel2();
virtual void _ReservedFilePanel3();
virtual void _ReservedFilePanel4();
virtual void _ReservedFilePanel5();
virtual void _ReservedFilePanel6();
virtual void _ReservedFilePanel7();
virtual void _ReservedFilePanel8();
#endif
BWindow *fWindow;
#if !_PR3_COMPATIBLE_
uint32 _reserved[10];
#endif
public:
// deprecated calls, do not use
BFilePanel(file_panel_mode mode, BMessenger *, entry_ref *,
uint32 , bool, BMessage *, BRefFilter *, bool modal,
bool hide_when_done);
void SetPanelDirectory(BEntry*);
void SetPanelDirectory(BDirectory*);
void SetPanelDirectory(entry_ref*);
};
#endif
+76
View File
@@ -0,0 +1,76 @@
/***************************************************************************
//
// File: NodeMonitor.h
//
// Description: The Node Monitor
//
// Copyright 1992-98, Be Incorporated, All Rights Reserved.
//
***************************************************************************/
#ifndef _NODE_MONITOR_H
#define _NODE_MONITOR_H
#ifndef _BE_BUILD_H
#include <BeBuild.h>
#endif
#include <StorageDefs.h>
#include <Node.h>
#include <Messenger.h>
class BLooper;
class BHandler;
_IMPEXP_BE status_t watch_node(const node_ref *node,
uint32 flags,
BMessenger target);
_IMPEXP_BE status_t watch_node(const node_ref *node,
uint32 flags,
const BHandler *handler,
const BLooper *looper = NULL);
_IMPEXP_BE status_t stop_watching(BMessenger target);
_IMPEXP_BE status_t stop_watching(const BHandler *handler,
const BLooper *looper=NULL);
/* Flags for the watch_node() call.
* Note that B_WATCH_MOUNT is NOT included in
* B_WATCH_ALL -- the latter is a convenience
* for watching all watchable state changes for
* a specific node. Watching for volumes
* being mounted and unmounted (B_WATCH_MOUNT)
* is in a category by itself.
*
* BVolumeRoster provides a handy cover for
* volume watching.
*/
enum {
B_STOP_WATCHING = 0x0000,
B_WATCH_NAME = 0x0001,
B_WATCH_STAT = 0x0002,
B_WATCH_ATTR = 0x0004,
B_WATCH_DIRECTORY = 0x0008,
B_WATCH_ALL = 0x000f,
B_WATCH_MOUNT = 0x0010
};
/* When a node monitor notification
* returns to the target, the "opcode" field
* will hold one of these values. The other
* fields in the message tell you which
* node (or device) changed. See the documentation
* for the names of these other fields.
*/
#define B_ENTRY_CREATED 1
#define B_ENTRY_REMOVED 2
#define B_ENTRY_MOVED 3
#define B_STAT_CHANGED 4
#define B_ATTR_CHANGED 5
#define B_DEVICE_MOUNTED 6
#define B_DEVICE_UNMOUNTED 7
#endif