// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// utility functions for get/write resources
//-----------------------------------------------------------------------------
// utility functions for get/write resources
//-----------------------------------------------------------------------------
- strcpy(buf, DEFAULT_XRESOURCE_DIR);
- strcat(buf, "/");
- strcat(buf, FileNameFromPath(name));
+ wxStrcpy(buf, DEFAULT_XRESOURCE_DIR);
+ wxStrcat(buf, _T("/"));
+ wxStrcat(buf, FileNameFromPath(name));
// Read $HOME for what it says is home, if not
// read $USER or $LOGNAME for user name else determine
// the Real User, then determine the Real home dir.
// Read $HOME for what it says is home, if not
// read $USER or $LOGNAME for user name else determine
// the Real User, then determine the Real home dir.
- if (*filename != '.') strcat(dest, ".");
- strcat(dest, filename);
+ if (*filename != _T('.')) wxStrcat(dest, _T("."));
+ wxStrcat(dest, filename);
char *classname = gdk_progclass; // Robert Roebling ??
char name[256];
(void)strcpy(name, "/usr/lib/X11/app-defaults/");
char *classname = gdk_progclass; // Robert Roebling ??
char name[256];
(void)strcpy(name, "/usr/lib/X11/app-defaults/");
// window when the server initializes and loaded into the display
// structure on XOpenDisplay;
// if not defined, use .Xdefaults
// window when the server initializes and loaded into the display
// structure on XOpenDisplay;
// if not defined, use .Xdefaults
- } else {
- (void)GetIniFile(filename, (char *) NULL);
- serverDB = XrmGetFileDatabase(filename);
+ }
+ else
+ {
+ (void)GetIniFile(filename, (wxChar *) NULL);
+ serverDB = XrmGetFileDatabase(wxConv_file.cWX2MB(filename));
// Open XENVIRONMENT file, or if not defined, the .Xdefaults,
// and merge into existing database
// Open XENVIRONMENT file, or if not defined, the .Xdefaults,
// and merge into existing database
- environment = GetIniFile(filename, (const char *) NULL);
- len = strlen(environment);
+#if wxUSE_UNICODE
+ char hostbuf[1024];
+#endif
+ environment = GetIniFile(filename, (const wxChar *) NULL);
+ len = wxStrlen(environment);
// called on application exit
//-----------------------------------------------------------------------------
// called on application exit
//-----------------------------------------------------------------------------
// If file doesn't exist, create it first.
(void)GetResourcePath(nameBuffer, file, TRUE);
XrmDatabase database = (XrmDatabase)node->Data();
// If file doesn't exist, create it first.
(void)GetResourcePath(nameBuffer, file, TRUE);
XrmDatabase database = (XrmDatabase)node->Data();
(void)GetIniFile(buffer, file);
wxNode *node = wxTheResourceCache->Find(buffer);
(void)GetIniFile(buffer, file);
wxNode *node = wxTheResourceCache->Find(buffer);
bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file )
{
bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file )
{
- database = XrmGetFileDatabase(buffer);
- wxLogTrace(wxTraceResAlloc, "Write: Number = %d", wxTheResourceCache->Number());
+ database = XrmGetFileDatabase(wxConv_file.cWX2MB(buffer));
+ wxLogTrace(wxTraceResAlloc, _T("Write: Number = %d"), wxTheResourceCache->Number());
- strcat(resName, entry);
- XrmPutStringResource(&database, resName, value);
+ strcat(resName, entry.mb_str());
+ XrmPutStringResource(&database, resName, value.mb_str());
// Is this right? Trying to get it to look in the user's
// home directory instead of current directory -- JACS
(void)GetIniFile(buffer, file);
// Is this right? Trying to get it to look in the user's
// home directory instead of current directory -- JACS
(void)GetIniFile(buffer, file);
- else {
- database = XrmGetFileDatabase(buffer);
- wxLogTrace(wxTraceResAlloc, "Get: Number = %d", wxTheResourceCache->Number());
+ }
+ else
+ {
+ database = XrmGetFileDatabase(wxConv_file.cWX2MB(buffer));
+ wxLogTrace(wxTraceResAlloc, _T("Get: Number = %d"), wxTheResourceCache->Number());
bool success = XrmGetResource(database, buf, "*", str_type, &xvalue);
// Try different combinations of upper/lower case, just in case...
bool success = XrmGetResource(database, buf, "*", str_type, &xvalue);
// Try different combinations of upper/lower case, just in case...
buf[0] = (isupper(buf[0]) ? tolower(buf[0]) : toupper(buf[0]));
success = XrmGetResource(database, buf, "*", str_type, &xvalue);
}
buf[0] = (isupper(buf[0]) ? tolower(buf[0]) : toupper(buf[0]));
success = XrmGetResource(database, buf, "*", str_type, &xvalue);
}
{
char *s = (char *) NULL;
bool succ = wxGetResource(section, entry, &s, file);
{
char *s = (char *) NULL;
bool succ = wxGetResource(section, entry, &s, file);
{
char *s = (char *) NULL;
bool succ = wxGetResource(section, entry, &s, file);
{
char *s = (char *) NULL;
bool succ = wxGetResource(section, entry, &s, file);
{
char *s = (char *) NULL;
bool succ = wxGetResource(section, entry, &s, file);
{
char *s = (char *) NULL;
bool succ = wxGetResource(section, entry, &s, file);
// Handle True, False here
// True, Yes, Enables, Set or Activated
if (*s == 'T' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A')
// Handle True, False here
// True, Yes, Enables, Set or Activated
if (*s == 'T' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A')