class Fox::FXFileDict
The File Association dictionary associates a file extension with a File Association record which contains command name, mime type, icons, and other information about the file type. The icons referenced by the file association are managed by the Icon Dictionary; this guarantees that each icon is loaded only once into memory. The associations are determined by the information by the FOX Registry settings; each entry under the FILETYPES registry section comprises the command line, extension name, large icon, small icon, and mime type:
command ';' extension ';' bigicon [ ':' bigiconopen ] ';' icon [ ':' iconopen ] ';' mime
For example, the binding for “jpg” could be:
xv %s &;JPEG Image;bigimage.xpm;miniimage.xpm;image/jpeg
The association for a file name is determined by first looking at the entire file name, then at the whole extension, and then at sub-extensions. For example, “name.tar.gz”, “tar.gz”, and “gz” can each be given a different file association. Directory names may also be given associations; there is no command-line association for a directory, however. The association for a directory is found by first checking the whole pathname, then checking the pathname less the first component, and so on. So, “/usr/local/include”, “/local/include”, and “/include” can each be given their own file associations. If the above lookup procedure has not found a file association, the system uses a fallback associations: for files, the fallback association is determined by the binding “defaultfilebinding”. For directories, the “defaultdirbinding” is used, and for executables the “defaultexecbinding” is used.
Attributes
Current icon search path {FXIconDict}
Current icon search path [String]
Settings database {FXSettings}
Public Class Methods
Source
SWIGINTERN VALUE
_wrap_FXFileDict_defaultDirBinding(int argc, VALUE *argv, VALUE self) {
VALUE result;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
result = (VALUE)FXFileDict_defaultDirBinding();
vresult = result;
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_defaultExecBinding(int argc, VALUE *argv, VALUE self) {
VALUE result;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
result = (VALUE)FXFileDict_defaultExecBinding();
vresult = result;
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_defaultFileBinding(int argc, VALUE *argv, VALUE self) {
VALUE result;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
result = (VALUE)FXFileDict_defaultFileBinding();
vresult = result;
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE _wrap_new_FXFileDict(int nargs, VALUE *args, VALUE self) {
int argc;
VALUE argv[2];
int ii;
argc = nargs;
if (argc > 2) SWIG_fail;
for (ii = 0; (ii < argc); ++ii) {
argv[ii] = args[ii];
}
if (argc == 1) {
int _v = 0;
void *vptr = 0;
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FXApp, 0);
_v = SWIG_CheckState(res);
if (_v) {
return _wrap_new_FXFileDict__SWIG_0(nargs, args, self);
}
}
if (argc == 2) {
int _v = 0;
void *vptr = 0;
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FXApp, 0);
_v = SWIG_CheckState(res);
if (_v) {
void *vptr = 0;
int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_FXSettings, 0);
_v = SWIG_CheckState(res);
if (_v) {
return _wrap_new_FXFileDict__SWIG_1(nargs, args, self);
}
}
}
fail:
Ruby_Format_OverloadedError( argc, 2, "FXFileDict.new",
" FXFileDict.new(FXApp *a)\n"
" FXFileDict.new(FXApp *a, FXSettings *db)\n");
return Qnil;
}
Source
# File lib/fox16/kwargs.rb, line 795 def initialize(app, *args, &blk) argument_names = %w{db} default_params = { :db => nil } params = {} params = args.pop if args.last.is_a? Hash args.each_with_index { |e, i| params[argument_names[i].intern] = e } params.keys.each { |key| raise ArgumentError, "Unrecognized parameter #{key}" unless default_params.keys.include?(key) } params = default_params.merge(params) old_initialize(app, params[:db], &blk) end
Public Instance Methods
Source
SWIGINTERN VALUE
_wrap_FXFileDict_find(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
FXchar *arg2 = (FXchar *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
FXFileAssoc *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict *","find", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
arg2 = NIL_P(argv[0]) ? 0 : StringValuePtr(argv[0]);
result = (FXFileAssoc *)(arg1)->find((FXchar const *)arg2);
vresult = FXRbGetRubyObj(result, "FXFileAssoc *");
return vresult;
fail:
return Qnil;
}
Find an element in the class.
Source
SWIGINTERN VALUE
_wrap_FXFileDict_findDirBinding(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
FXchar *arg2 = (FXchar *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
FXFileAssoc *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict *","findDirBinding", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
arg2 = NIL_P(argv[0]) ? 0 : StringValuePtr(argv[0]);
result = (FXFileAssoc *)FXFileDict_findDirBinding(arg1,(char const *)arg2);
vresult = FXRbGetRubyObj(result, "FXFileAssoc *");
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_findExecBinding(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
FXchar *arg2 = (FXchar *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
FXFileAssoc *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict *","findExecBinding", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
arg2 = NIL_P(argv[0]) ? 0 : StringValuePtr(argv[0]);
result = (FXFileAssoc *)FXFileDict_findExecBinding(arg1,(char const *)arg2);
vresult = FXRbGetRubyObj(result, "FXFileAssoc *");
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_findFileBinding(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
FXchar *arg2 = (FXchar *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
FXFileAssoc *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict *","findFileBinding", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
arg2 = NIL_P(argv[0]) ? 0 : StringValuePtr(argv[0]);
result = (FXFileAssoc *)FXFileDict_findFileBinding(arg1,(char const *)arg2);
vresult = FXRbGetRubyObj(result, "FXFileAssoc *");
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_getIconDict(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
FXIconDict *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict const *","getIconDict", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
result = (FXIconDict *)((FXFileDict const *)arg1)->getIconDict();
vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_FXIconDict, 0 | 0 );
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_getIconPath(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
FXString *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict const *","getIconPath", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
result = (FXString *) &((FXFileDict const *)arg1)->getIconPath();
vresult = to_ruby(result->text());
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_getSettings(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
FXSettings *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict const *","getSettings", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
result = (FXSettings *)((FXFileDict const *)arg1)->getSettings();
vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_FXSettings, 0 | 0 );
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_load(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
FXStream *arg2 = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict *","load", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_FXStream, 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "FXStream &","load", 2, argv[0] ));
}
if (!argp2) {
SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "FXStream &","load", 2, argv[0]));
}
arg2 = reinterpret_cast< FXStream * >(argp2);
FXFileDict_load(arg1,*arg2);
return Qnil;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_remove(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
FXchar *arg2 = (FXchar *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
FXFileAssoc *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict *","remove", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
arg2 = NIL_P(argv[0]) ? 0 : StringValuePtr(argv[0]);
result = (FXFileAssoc *)(arg1)->remove((FXchar const *)arg2);
vresult = FXRbGetRubyObj(result, "FXFileAssoc *");
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_replace(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
FXchar *arg2 = (FXchar *) 0 ;
FXchar *arg3 = (FXchar *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
FXFileAssoc *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 2) || (argc > 2)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict *","replace", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
arg2 = NIL_P(argv[0]) ? 0 : StringValuePtr(argv[0]);
arg3 = NIL_P(argv[1]) ? 0 : StringValuePtr(argv[1]);
result = (FXFileAssoc *)(arg1)->replace((FXchar const *)arg2,(FXchar const *)arg3);
vresult = FXRbGetRubyObj(result, "FXFileAssoc *");
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_save(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
FXStream *arg2 = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict const *","save", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_FXStream, 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "FXStream &","save", 2, argv[0] ));
}
if (!argp2) {
SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "FXStream &","save", 2, argv[0]));
}
arg2 = reinterpret_cast< FXStream * >(argp2);
FXFileDict_save((FXFileDict const *)arg1,*arg2);
return Qnil;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_setIconDict(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
FXIconDict *arg2 = (FXIconDict *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict *","setIconDict", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_FXIconDict, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "FXIconDict *","setIconDict", 2, argv[0] ));
}
arg2 = reinterpret_cast< FXIconDict * >(argp2);
(arg1)->setIconDict(arg2);
return Qnil;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_setIconPath(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
FXString *arg2 = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
SwigValueWrapper< FXString > p2 ;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict *","setIconPath", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
p2 = to_FXString(argv[0]); arg2 = &p2;
(arg1)->setIconPath((FXString const &)*arg2);
return Qnil;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXFileDict_setSettings(int argc, VALUE *argv, VALUE self) {
FXFileDict *arg1 = (FXFileDict *) 0 ;
FXSettings *arg2 = (FXSettings *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_FXFileDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXFileDict *","setSettings", 1, self ));
}
arg1 = reinterpret_cast< FXFileDict * >(argp1);
res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_FXSettings, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "FXSettings *","setSettings", 2, argv[0] ));
}
arg2 = reinterpret_cast< FXSettings * >(argp2);
(arg1)->setSettings(arg2);
return Qnil;
fail:
return Qnil;
}