/usr/include/IVGlyph/ofilechooser.h is in ivtools-dev 1.2.11a1-8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | /*
* Copyright (c) 1995-1996 Vectaport Inc.
* Copyright (c) 1991 Stanford University
* Copyright (c) 1991 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the names of the copyright holders not be used in
* advertising or publicity pertaining to distribution of the software
* without specific, written prior permission. The copyright holders make
* no representations about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
* IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* OpenFileChooser -- select a file
*/
#ifndef open_file_chooser_h
#define open_file_chooser_h
#include <InterViews/dialog.h>
#include <InterViews/resource.h>
#include <OS/directory.h>
#include <InterViews/action.h>
#include <IV-look/field.h>
#include <IV-3_1/InterViews/dialog.h>
#include <InterViews/_enter.h>
class Action;
class Directory;
class FieldEditor;
class FieldEditorAction;
class FileBrowser;
class Glyph;
class ObservableText;
class OpenFileChooser;
class OpenFileChooserImpl;
class String;
class TextObserver;
class TransientWindow;
class WidgetKit;
class OpenFileChooserAction : public Resource {
protected:
OpenFileChooserAction();
virtual ~OpenFileChooserAction();
public:
virtual void execute(OpenFileChooser*, boolean accept);
};
#if defined(__STDC__) || defined(__ANSI_CPP__)
#define OpenFileChooserCallback(T) T##_OpenFileChooserCallback
#define OpenFileChooserMemberFunction(T) T##_OpenFileChooserMemberFunction
#else
#define OpenFileChooserCallback(T) T/**/_OpenFileChooserCallback
#define OpenFileChooserMemberFunction(T) T/**/_OpenFileChooserMemberFunction
#endif
#define declareOpenFileChooserCallback(T) \
typedef void (T::*OpenFileChooserMemberFunction(T))(OpenFileChooser*, boolean); \
class OpenFileChooserCallback(T) : public OpenFileChooserAction { \
public: \
OpenFileChooserCallback(T)(T*, OpenFileChooserMemberFunction(T)); \
virtual ~OpenFileChooserCallback(T)(); \
\
virtual void execute(OpenFileChooser*, boolean accept); \
private: \
T* obj_; \
OpenFileChooserMemberFunction(T) func_; \
};
#define implementOpenFileChooserCallback(T) \
OpenFileChooserCallback(T)::OpenFileChooserCallback(T)( \
T* obj, OpenFileChooserMemberFunction(T) func \
) { \
obj_ = obj; \
func_ = func; \
} \
\
OpenFileChooserCallback(T)::~OpenFileChooserCallback(T)() { } \
\
void OpenFileChooserCallback(T)::execute(OpenFileChooser* f, boolean accept) { \
OpenFileChooserMemberFunction(T) pf = func_; \
(obj_->*pf)(f, accept); \
}
class OpenFileChooser : public Dialog {
public:
OpenFileChooser(
const String& dir, WidgetKit*, Style*, OpenFileChooserAction* = nil
);
OpenFileChooser( Style* );
virtual ~OpenFileChooser();
virtual const String* selected() const;
virtual void reread();
virtual void dismiss(boolean);
virtual boolean post_for_aligned(Window*, float xalign, float yalign);
void unmap();
virtual boolean saveas_chooser();
TransientWindow* twindow();
virtual void updatecaption();
static boolean url_use_ok();
// test if url use ok for pathnames. Same as ParamList method.
static boolean urltest(const char*);
// test if pathname looks like a URL. Same as ParamList method.
static int bintest(const char* name);
// return 0 if executable can be found, otherwise -1.
static boolean bincheck(const char* name);
// return true if executable can be found.
protected:
OpenFileChooserImpl* impl_;
TransientWindow* _t;
};
class OpenFileChooserImpl {
public:
friend class OpenFileChooser;
String* name_;
WidgetKit* kit_;
OpenFileChooser* fchooser_;
FileBrowser* fbrowser_;
FieldEditor* editor_;
FieldEditor* filter_;
FieldEditor* directory_filter_;
int* filter_map_;
Directory* dir_;
OpenFileChooserAction* action_;
const String* selected_;
Style* style_;
Action* update_;
ObservableText* caption_;
TextObserver* captionview_;
ObservableText* subcaption_;
TextObserver* subcaptionview_;
void init(OpenFileChooser*, Style*, OpenFileChooserAction*);
virtual void free();
virtual void build();
virtual void updatecaption();
void clear();
void load();
FieldEditor* add_filter(
Style*,
const char* pattern_attribute, const char* default_pattern,
const char* caption_attribute, const char* default_caption,
Glyph*, FieldEditorAction*
);
boolean filtered(const String&, FieldEditor*);
virtual void accept_browser();
virtual void cancel_browser();
virtual void accept_editor(FieldEditor*);
virtual void cancel_editor(FieldEditor*);
virtual void accept_filter(FieldEditor*);
boolean chdir(const String&);
};
declareFieldEditorCallback(OpenFileChooserImpl)
declareActionCallback(OpenFileChooserImpl)
#include <InterViews/_leave.h>
#endif
|