class Fox::FXIconDict
The Icon Dictionary manages a collection of icons. The icons are referenced by their file name. When first encountering a new file name, the icon is located by searching the icon search path for the icon file. If found, the services of the icon source object are used to load the icon from the file. A custom icon source may be installed to furnish support for additonal image file formats. Once the icon is loaded, an association between the icon name and the icon is entered into the icon dictionary. Subsequent searches for an icon with this name will be satisfied from the cached value. The lifetype of the icons is managed by the icon dictionary, and thus all icons will be deleted when the dictionary is deleted.
Public Class Methods
Source
SWIGINTERN VALUE
_wrap_FXIconDict_defaultIconPath(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)FXIconDict_defaultIconPath();
vresult = result;
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_new_FXIconDict(int argc, VALUE *argv, VALUE self) {
FXApp *arg1 = (FXApp *) 0 ;
FXString const &arg2_defvalue = FXIconDict::defaultIconPath ;
FXString *arg2 = (FXString *) &arg2_defvalue ;
void *argp1 = 0 ;
int res1 = 0 ;
SwigValueWrapper< FXString > p2 ;
FXIconDict *result = 0 ;
if ((argc < 1) || (argc > 2)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_FXApp, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXApp *","FXIconDict", 1, argv[0] ));
}
arg1 = reinterpret_cast< FXApp * >(argp1);
if (argc > 1) {
p2 = to_FXString(argv[1]); arg2 = &p2;
}
{
if (!arg1) {
SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
}
}
{
result = (FXIconDict *)new_FXIconDict(arg1,(FXString const &)*arg2);
DATA_PTR(self) = result; FXRbRegisterRubyObj(self, result);
if(rb_block_given_p()){
rb_yield(self);
}
}
return self;
fail:
return Qnil;
}
Source
# File lib/fox16/kwargs.rb, line 1123 def initialize(app, *args, &blk) argument_names = %w{path} default_params = { :path => FXIconDict.defaultIconPath } 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[:path], &blk) end
Public Instance Methods
Source
SWIGINTERN VALUE
_wrap_FXIconDict_find(int argc, VALUE *argv, VALUE self) {
FXIconDict *arg1 = (FXIconDict *) 0 ;
FXchar *arg2 = (FXchar *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
FXIcon *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_FXIconDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXIconDict *","find", 1, self ));
}
arg1 = reinterpret_cast< FXIconDict * >(argp1);
arg2 = NIL_P(argv[0]) ? 0 : StringValuePtr(argv[0]);
result = (FXIcon *)(arg1)->find((FXchar const *)arg2);
{
swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_FXIcon, (void **) &result);
vresult = FXRbGetRubyObj(result, ty);
}
return vresult;
fail:
return Qnil;
}
Find an element in the class.
Source
SWIGINTERN VALUE
_wrap_FXIconDict_iconPath(int argc, VALUE *argv, VALUE self) {
FXIconDict *arg1 = (FXIconDict *) 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_FXIconDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXIconDict const *","getIconPath", 1, self ));
}
arg1 = reinterpret_cast< FXIconDict * >(argp1);
result = (FXString *) &((FXIconDict const *)arg1)->getIconPath();
vresult = to_ruby(result->text());
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXIconDict_iconPathe___(int argc, VALUE *argv, VALUE self) {
FXIconDict *arg1 = (FXIconDict *) 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_FXIconDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXIconDict *","setIconPath", 1, self ));
}
arg1 = reinterpret_cast< FXIconDict * >(argp1);
p2 = to_FXString(argv[0]); arg2 = &p2;
(arg1)->setIconPath((FXString const &)*arg2);
return Qnil;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXIconDict_iconSource(int argc, VALUE *argv, VALUE self) {
FXIconDict *arg1 = (FXIconDict *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
FXIconSource *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_FXIconDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXIconDict const *","getIconSource", 1, self ));
}
arg1 = reinterpret_cast< FXIconDict * >(argp1);
result = (FXIconSource *)((FXIconDict const *)arg1)->getIconSource();
vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_FXIconSource, 0 | 0 );
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXIconDict_iconSourcee___(int argc, VALUE *argv, VALUE self) {
FXIconDict *arg1 = (FXIconDict *) 0 ;
FXIconSource *arg2 = (FXIconSource *) 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_FXIconDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXIconDict *","setIconSource", 1, self ));
}
arg1 = reinterpret_cast< FXIconDict * >(argp1);
res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_FXIconSource, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "FXIconSource *","setIconSource", 2, argv[0] ));
}
arg2 = reinterpret_cast< FXIconSource * >(argp2);
(arg1)->setIconSource(arg2);
return Qnil;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXIconDict_insert(int argc, VALUE *argv, VALUE self) {
FXIconDict *arg1 = (FXIconDict *) 0 ;
FXchar *arg2 = (FXchar *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
FXIcon *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_FXIconDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXIconDict *","insert", 1, self ));
}
arg1 = reinterpret_cast< FXIconDict * >(argp1);
arg2 = NIL_P(argv[0]) ? 0 : StringValuePtr(argv[0]);
result = (FXIcon *)(arg1)->insert((FXchar const *)arg2);
{
swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_FXIcon, (void **) &result);
vresult = FXRbGetRubyObj(result, ty);
}
return vresult;
fail:
return Qnil;
}
Insert one or more new elements in the FXIconDict.
Source
SWIGINTERN VALUE
_wrap_FXIconDict_remove(int argc, VALUE *argv, VALUE self) {
FXIconDict *arg1 = (FXIconDict *) 0 ;
FXchar *arg2 = (FXchar *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
FXIcon *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_FXIconDict, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXIconDict *","remove", 1, self ));
}
arg1 = reinterpret_cast< FXIconDict * >(argp1);
arg2 = NIL_P(argv[0]) ? 0 : StringValuePtr(argv[0]);
result = (FXIcon *)(arg1)->remove((FXchar const *)arg2);
{
swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_FXIcon, (void **) &result);
vresult = FXRbGetRubyObj(result, ty);
}
return vresult;
fail:
return Qnil;
}