class Fox::FXRegistry
The registry maintains a database of persistent settings for an application. The settings database is organized in two groups of three layers each. The system-wide settings group contains settings information pertaining to all users on a system. The per-user settings group contains settings affecting that user only. Each settings group contains a desktop layer, which comprises the settings which affect all FOX programs, a vendor layer which holds settings that affect all applications from that vendor (e.g. a application-suite), and an application layer which holds settings only for a single application. The vendor-key and application-key determine which files these layers come from, while the “Desktop” key is used for all FOX applications. Settings in the system-wide group are overwritten by the per-user group, and settings from the “Desktop” layer are overwritten by the vendor-layer; vendor-layer settings are overwritten by the application-layer settings. Only the per-user, per-application settings ever gets written; the layers in the system-group only get written during installation and configuration of the application. The registry is read when FXApp::init() is called, and written back to the system when FXApp::exit() is called.
Attributes
Application key [String]
Use file-based registry instead of Windows Registry [Boolean]
Vendor key [String]
Public Class Methods
Source
SWIGINTERN VALUE
_wrap_new_FXRegistry(int argc, VALUE *argv, VALUE self) {
FXString const &arg1_defvalue = FXString::null ;
FXString *arg1 = (FXString *) &arg1_defvalue ;
FXString const &arg2_defvalue = FXString::null ;
FXString *arg2 = (FXString *) &arg2_defvalue ;
SwigValueWrapper< FXString > p1 ;
SwigValueWrapper< FXString > p2 ;
FXRegistry *result = 0 ;
if ((argc < 0) || (argc > 2)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
if (argc > 0) {
p1 = to_FXString(argv[0]); arg1 = &p1;
}
if (argc > 1) {
p2 = to_FXString(argv[1]); arg2 = &p2;
}
{
result = (FXRegistry *)new_FXRegistry((FXString const &)*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 1939 def initialize(*args, &blk) argument_names = %w{appKey vendorKey} default_params = { :appKey => "", :vendorKey => "" } 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(params[:appKey], params[:vendorKey], &blk) end
Public Instance Methods
Source
# File rdoc-sources/FXRegistry.rb, line 54 def asciiMode?; end
Return true if we’re using a file-based registry mechanism instead of the Windows Registry (only relevant on Windows systems).
Source
SWIGINTERN VALUE
_wrap_FXRegistry_getAppKey(int argc, VALUE *argv, VALUE self) {
FXRegistry *arg1 = (FXRegistry *) 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_FXRegistry, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXRegistry const *","getAppKey", 1, self ));
}
arg1 = reinterpret_cast< FXRegistry * >(argp1);
result = (FXString *) &((FXRegistry const *)arg1)->getAppKey();
vresult = to_ruby(result->text());
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXRegistry_getAsciiMode(int argc, VALUE *argv, VALUE self) {
FXRegistry *arg1 = (FXRegistry *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
bool result;
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_FXRegistry, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXRegistry const *","getAsciiMode", 1, self ));
}
arg1 = reinterpret_cast< FXRegistry * >(argp1);
result = (bool)((FXRegistry const *)arg1)->getAsciiMode();
vresult = SWIG_From_bool(static_cast< bool >(result));
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXRegistry_getVendorKey(int argc, VALUE *argv, VALUE self) {
FXRegistry *arg1 = (FXRegistry *) 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_FXRegistry, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXRegistry const *","getVendorKey", 1, self ));
}
arg1 = reinterpret_cast< FXRegistry * >(argp1);
result = (FXString *) &((FXRegistry const *)arg1)->getVendorKey();
vresult = to_ruby(result->text());
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXRegistry_load(int argc, VALUE *argv, VALUE self) {
FXRegistry *arg1 = (FXRegistry *) 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_FXRegistry, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXRegistry *","load", 1, self ));
}
arg1 = reinterpret_cast< FXRegistry * >(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);
FXRegistry_load(arg1,*arg2);
return Qnil;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXRegistry_read(int argc, VALUE *argv, VALUE self) {
FXRegistry *arg1 = (FXRegistry *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
bool result;
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_FXRegistry, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXRegistry *","read", 1, self ));
}
arg1 = reinterpret_cast< FXRegistry * >(argp1);
result = (bool)(arg1)->read();
vresult = SWIG_From_bool(static_cast< bool >(result));
return vresult;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXRegistry_save(int argc, VALUE *argv, VALUE self) {
FXRegistry *arg1 = (FXRegistry *) 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_FXRegistry, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXRegistry const *","save", 1, self ));
}
arg1 = reinterpret_cast< FXRegistry * >(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);
FXRegistry_save((FXRegistry const *)arg1,*arg2);
return Qnil;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXRegistry_setAsciiMode(int argc, VALUE *argv, VALUE self) {
FXRegistry *arg1 = (FXRegistry *) 0 ;
bool arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
bool val2 ;
int ecode2 = 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_FXRegistry, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXRegistry *","setAsciiMode", 1, self ));
}
arg1 = reinterpret_cast< FXRegistry * >(argp1);
ecode2 = SWIG_AsVal_bool(argv[0], &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","setAsciiMode", 2, argv[0] ));
}
arg2 = static_cast< bool >(val2);
(arg1)->setAsciiMode(arg2);
return Qnil;
fail:
return Qnil;
}
Source
SWIGINTERN VALUE
_wrap_FXRegistry_write(int argc, VALUE *argv, VALUE self) {
FXRegistry *arg1 = (FXRegistry *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
bool result;
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_FXRegistry, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "FXRegistry *","write", 1, self ));
}
arg1 = reinterpret_cast< FXRegistry * >(argp1);
result = (bool)(arg1)->write();
vresult = SWIG_From_bool(static_cast< bool >(result));
return vresult;
fail:
return Qnil;
}