../../src/palmos/help.cpp \
../../src/palmos/icon.cpp \
../../src/palmos/imaglist.cpp \
-../../src/palmos/iniconf.cpp \
../../src/palmos/joystick.cpp \
../../src/palmos/listbox.cpp \
../../src/palmos/listctrl.cpp \
../../src/palmos/palette.cpp \
../../src/palmos/pen.cpp \
../../src/palmos/popupwin.cpp \
+../../src/palmos/prefconf.cpp \
../../src/palmos/printdlg.cpp \
../../src/palmos/printpalm.cpp \
../../src/palmos/radiobox.cpp \
../../src/palmos/radiobut.cpp \
-../../src/palmos/regconf.cpp \
../../src/palmos/region.cpp \
../../src/palmos/scrolbar.cpp \
../../src/palmos/settings.cpp \
- polishing of the port (unnecessary 2.4 API compatibility, removed
all wxMSW specific code which was base for the new port)
- enumeration of available volumes
+- native wxPrefConfig around Preferences database
2.5.3
#include "wx/confbase.h"
#if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE
-# ifdef __WIN32__
-# include "wx/msw/regconf.h"
-#else
-# include "wx/msw/iniconf.h"
-# endif
+# ifdef __WIN32__
+# include "wx/msw/regconf.h"
+# else
+# include "wx/msw/iniconf.h"
+# endif
+#elif defined(__WXPALMOS__) && wxUSE_CONFIG_NATIVE
+# include "wx/palmos/prefconf.h"
#else
# include "wx/fileconf.h"
#endif
#error "wxPalmOS port was introduced after 2.4.X"
#endif
+#ifdef wxUSE_FILECONFIG
+ #undef wxUSE_FILECONFIG
+#endif
+#define wxUSE_FILECONFIG 0
+
/*
* disable the settings which don't work for some compilers
*/
+++ /dev/null
-///////////////////////////////////////////////////////////////////////////////
-// Name: include/wx/palmos/iniconf.h
-// Purpose: INI-file based wxConfigBase implementation
-// Author: William Osborne
-// Modified by:
-// Created: 10/13/04
-// RCS-ID: $Id:
-// Copyright: (c) William Osborne
-// Licence: wxWindows licence
-///////////////////////////////////////////////////////////////////////////////
-
-#ifndef _INICONF_H
-#define _INICONF_H
-
-// ----------------------------------------------------------------------------
-// wxIniConfig is a wxConfig implementation which uses MS Windows INI files to
-// store the data. Because INI files don't really support arbitrary nesting of
-// groups, we do the following:
-// (1) in win.ini file we store all entries in the [vendor] section and
-// the value group1/group2/key is mapped to the value group1_group2_key
-// in this section, i.e. all path separators are replaced with underscore
-// (2) in appname.ini file we map group1/group2/group3/key to the entry
-// group2_group3_key in [group1]
-//
-// Of course, it might lead to indesirable results if '_' is also used in key
-// names (i.e. group/key is the same as group_key) and also GetPath() result
-// may be not what you would expect it to be.
-//
-// Another limitation: the keys and section names are never case-sensitive
-// which might differ from wxFileConfig it it was compiled with
-// wxCONFIG_CASE_SENSITIVE option.
-// ----------------------------------------------------------------------------
-
-// for this class, "local" file is the file appname.ini and the global file
-// is the [vendor] subsection of win.ini (default for "vendor" is to be the
-// same as appname). The file name (strAppName parameter) may, in fact,
-// contain the full path to the file. If it doesn't, the file is searched for
-// in the Windows directory.
-class WXDLLEXPORT wxIniConfig : public wxConfigBase
-{
-public:
- // ctor & dtor
- // if strAppName doesn't contain the extension and is not an absolute path,
- // ".ini" is appended to it. if strVendor is empty, it's taken to be the
- // same as strAppName.
- wxIniConfig(const wxString& strAppName = wxEmptyString, const wxString& strVendor = wxEmptyString,
- const wxString& localFilename = wxEmptyString, const wxString& globalFilename = wxEmptyString, long style = wxCONFIG_USE_LOCAL_FILE);
- virtual ~wxIniConfig();
-
- // implement inherited pure virtual functions
- virtual void SetPath(const wxString& strPath);
- virtual const wxString& GetPath() const;
-
- virtual bool GetFirstGroup(wxString& str, long& lIndex) const;
- virtual bool GetNextGroup (wxString& str, long& lIndex) const;
- virtual bool GetFirstEntry(wxString& str, long& lIndex) const;
- virtual bool GetNextEntry (wxString& str, long& lIndex) const;
-
- virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const;
- virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const;
-
- virtual bool HasGroup(const wxString& strName) const;
- virtual bool HasEntry(const wxString& strName) const;
-
- // return TRUE if the current group is empty
- bool IsEmpty() const;
-
- virtual bool Flush(bool bCurrentOnly = FALSE);
-
- virtual bool RenameEntry(const wxString& oldName, const wxString& newName);
- virtual bool RenameGroup(const wxString& oldName, const wxString& newName);
-
- virtual bool DeleteEntry(const wxString& Key, bool bGroupIfEmptyAlso = TRUE);
- virtual bool DeleteGroup(const wxString& szKey);
- virtual bool DeleteAll();
-
-protected:
- // read/write
- bool DoReadString(const wxString& key, wxString *pStr) const;
- bool DoReadLong(const wxString& key, long *plResult) const;
-
- bool DoWriteString(const wxString& key, const wxString& szValue);
- bool DoWriteLong(const wxString& key, long lValue);
-
-private:
- // helpers
- wxString GetPrivateKeyName(const wxString& szKey) const;
- wxString GetKeyName(const wxString& szKey) const;
-
- wxString m_strLocalFilename; // name of the private INI file
- wxString m_strGroup, // current group in appname.ini file
- m_strPath; // the rest of the path (no trailing '_'!)
-};
-
-#endif //_INICONF_H
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// Name: wx/palmos/prefconf.h
+// Purpose: wxPrefConfig interface
+// Author: Wlodzimierz ABX Skiba
+// Modified by:
+// Created: 28.12.2004
+// RCS-ID: $Id$
+// Copyright: (c) Wlodzimierz Skiba
+// License: wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _PREFCONF_H_
+#define _PREFCONF_H_
+
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+#pragma interface "prefconf.h"
+#endif
+
+// ----------------------------------------------------------------------------
+// wxPrefConfig
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_BASE wxPrefConfig : public wxConfigBase
+{
+public:
+ // ctor & dtor
+ wxPrefConfig(const wxString& appName = wxEmptyString,
+ const wxString& vendorName = wxEmptyString,
+ const wxString& localFilename = wxEmptyString,
+ const wxString& globalFilename = wxEmptyString,
+ long style = wxCONFIG_USE_GLOBAL_FILE);
+
+ // dtor will save unsaved data
+ virtual ~wxPrefConfig(){}
+
+ // implement inherited pure virtual functions
+ // ------------------------------------------
+
+ // path management
+ virtual void SetPath(const wxString& strPath);
+ virtual const wxString& GetPath() const { return m_strPath; }
+
+ // entry/subgroup info
+ virtual bool GetFirstGroup(wxString& str, long& lIndex) const;
+ virtual bool GetNextGroup (wxString& str, long& lIndex) const;
+ virtual bool GetFirstEntry(wxString& str, long& lIndex) const;
+ virtual bool GetNextEntry (wxString& str, long& lIndex) const;
+
+ // tests for existence
+ virtual bool HasGroup(const wxString& strName) const;
+ virtual bool HasEntry(const wxString& strName) const;
+ virtual EntryType GetEntryType(const wxString& name) const;
+
+ // get number of entries/subgroups in the current group, with or without
+ // it's subgroups
+ virtual size_t GetNumberOfEntries(bool bRecursive = false) const;
+ virtual size_t GetNumberOfGroups(bool bRecursive = false) const;
+
+ virtual bool Flush(bool WXUNUSED(bCurrentOnly) = false) { return true; }
+
+ // rename
+ virtual bool RenameEntry(const wxString& oldName, const wxString& newName);
+ virtual bool RenameGroup(const wxString& oldName, const wxString& newName);
+
+ // delete
+ virtual bool DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso = true);
+ virtual bool DeleteGroup(const wxString& key);
+ virtual bool DeleteAll();
+
+protected:
+ // implement read/write methods
+ virtual bool DoReadString(const wxString& key, wxString *pStr) const;
+ virtual bool DoReadLong(const wxString& key, long *plResult) const;
+
+ virtual bool DoWriteString(const wxString& key, const wxString& szValue);
+ virtual bool DoWriteLong(const wxString& key, long lValue);
+
+private:
+ // no copy ctor/assignment operator
+ wxPrefConfig(const wxPrefConfig&);
+ wxPrefConfig& operator=(const wxPrefConfig&);
+
+ // current path (not '/' terminated)
+ wxString m_strPath;
+
+ // current path (group) content (cache for read/write)
+ wxString m_strGroup;
+
+ // current group modified ?
+ bool m_modGroup;
+};
+
+#endif // _PREFCONF_H_
+
+++ /dev/null
-///////////////////////////////////////////////////////////////////////////////
-// Name: palmos/regconf.h
-// Purpose: Registry based implementation of wxConfigBase
-// Author: William Osborne
-// Modified by:
-// Created: 10/13/04
-// RCS-ID: $Id:
-// Copyright: (c) William Osborne
-// Licence: wxWindows licence
-///////////////////////////////////////////////////////////////////////////////
-
-#ifndef _REGCONF_H
-#define _REGCONF_H
-
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma interface "regconf.h"
-#endif
-
-#ifndef _REGISTRY_H
- #include "wx/palmos/registry.h"
-#endif
-#include "wx/object.h"
-
-// ----------------------------------------------------------------------------
-// wxRegConfig
-// ----------------------------------------------------------------------------
-
-class WXDLLIMPEXP_BASE wxRegConfig : public wxConfigBase
-{
-public:
- // ctor & dtor
- // will store data in HKLM\appName and HKCU\appName
- wxRegConfig(const wxString& appName = wxEmptyString,
- const wxString& vendorName = wxEmptyString,
- const wxString& localFilename = wxEmptyString,
- const wxString& globalFilename = wxEmptyString,
- long style = wxCONFIG_USE_GLOBAL_FILE);
-
- // dtor will save unsaved data
- virtual ~wxRegConfig();
-
- // implement inherited pure virtual functions
- // ------------------------------------------
-
- // path management
- virtual void SetPath(const wxString& strPath);
- virtual const wxString& GetPath() const { return m_strPath; }
-
- // entry/subgroup info
- // enumerate all of them
- virtual bool GetFirstGroup(wxString& str, long& lIndex) const;
- virtual bool GetNextGroup (wxString& str, long& lIndex) const;
- virtual bool GetFirstEntry(wxString& str, long& lIndex) const;
- virtual bool GetNextEntry (wxString& str, long& lIndex) const;
-
- // tests for existence
- virtual bool HasGroup(const wxString& strName) const;
- virtual bool HasEntry(const wxString& strName) const;
- virtual EntryType GetEntryType(const wxString& name) const;
-
- // get number of entries/subgroups in the current group, with or without
- // it's subgroups
- virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const;
- virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const;
-
- virtual bool Flush(bool WXUNUSED(bCurrentOnly) = FALSE) { return TRUE; }
-
- // rename
- virtual bool RenameEntry(const wxString& oldName, const wxString& newName);
- virtual bool RenameGroup(const wxString& oldName, const wxString& newName);
-
- // delete
- virtual bool DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso = TRUE);
- virtual bool DeleteGroup(const wxString& key);
- virtual bool DeleteAll();
-
-protected:
- // opens the local key creating it if necessary and returns it
- wxRegKey& LocalKey() const // must be const to be callable from const funcs
- {
- wxRegConfig* self = wxConstCast(this, wxRegConfig);
-
- if ( !m_keyLocal.IsOpened() )
- {
- // create on demand
- self->m_keyLocal.Create();
- }
-
- return self->m_keyLocal;
- }
-
- // implement read/write methods
- virtual bool DoReadString(const wxString& key, wxString *pStr) const;
- virtual bool DoReadLong(const wxString& key, long *plResult) const;
-
- virtual bool DoWriteString(const wxString& key, const wxString& szValue);
- virtual bool DoWriteLong(const wxString& key, long lValue);
-
-private:
- // no copy ctor/assignment operator
- wxRegConfig(const wxRegConfig&);
- wxRegConfig& operator=(const wxRegConfig&);
-
- // these keys are opened during all lifetime of wxRegConfig object
- wxRegKey m_keyLocalRoot, m_keyLocal,
- m_keyGlobalRoot, m_keyGlobal;
-
- // current path (not '/' terminated)
- wxString m_strPath;
-};
-
-#endif //_REGCONF_H
+++ /dev/null
-///////////////////////////////////////////////////////////////////////////////
-// Name: palmos/registry.h
-// Purpose: Registry classes and functions
-// Author: William Osborne
-// Modified by:
-// Created: 10/13/04
-// RCS-ID: $Id:
-// Copyright: (c) William Osborne
-// Licence: wxWindows licence
-///////////////////////////////////////////////////////////////////////////////
-
-#ifndef _REGISTRY_H
-#define _REGISTRY_H
-
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma interface "registry.h"
-#endif
-
-// ----------------------------------------------------------------------------
-// types used in this module
-// ----------------------------------------------------------------------------
-
-/*
-#ifndef HKEY_DEFINED
- #define HKEY_DEFINED
- #define HKEY unsigned long
-#endif
-*/
-
-typedef unsigned long ulong;
-
-// ----------------------------------------------------------------------------
-// class wxRegKey encapsulates window HKEY handle
-// ----------------------------------------------------------------------------
-class WXDLLIMPEXP_BASE wxRegKey
-{
-public:
- // NB: do _not_ change the values of elements in these enumerations!
-
- // registry value types (with comments from winnt.h)
- enum ValueType
- {
- Type_None, // No value type
- Type_String, // Unicode nul terminated string
- };
-
- // predefined registry keys
- enum StdKey
- {
- HKCR // classes root
- };
-
- // access mode for the key
- enum AccessMode
- {
- Read, // read-only
- Write // read and write
- };
-
- // information about standard (predefined) registry keys
- // number of standard keys
- static const size_t nStdKeys;
- // get the name of a standard key
- static const wxChar *GetStdKeyName(size_t key);
- // get the short name of a standard key
- static const wxChar *GetStdKeyShortName(size_t key);
- // get StdKey from root HKEY
- static StdKey GetStdKeyFromHkey(WXHKEY hkey);
-
- // extacts the std key prefix from the string (return value) and
- // leaves only the part after it (i.e. modifies the string passed!)
- static StdKey ExtractKeyName(wxString& str);
-
- // ctors
- // root key is set to HKCR (the only root key under Win16)
- wxRegKey();
- // strKey is the full name of the key (i.e. starting with HKEY_xxx...)
- wxRegKey(const wxString& strKey);
- // strKey is the name of key under (standard key) keyParent
- wxRegKey(StdKey keyParent, const wxString& strKey);
- // strKey is the name of key under (previously created) keyParent
- wxRegKey(const wxRegKey& keyParent, const wxString& strKey);
- // dtor closes the key
- ~wxRegKey();
-
- // change key (closes the previously opened key if any)
- // the name is absolute, i.e. should start with HKEY_xxx
- void SetName(const wxString& strKey);
- // the name is relative to the parent key
- void SetName(StdKey keyParent, const wxString& strKey);
- // the name is relative to the parent key
- void SetName(const wxRegKey& keyParent, const wxString& strKey);
- // hKey should be opened and will be closed in wxRegKey dtor
- void SetHkey(WXHKEY hKey);
-
- // get infomation about the key
- // get the (full) key name. Abbreviate std root keys if bShortPrefix.
- wxString GetName(bool bShortPrefix = true) const;
- // return true if the key exists
- bool Exists() const;
- // get the info about key (any number of these pointers may be NULL)
- bool GetKeyInfo(size_t *pnSubKeys, // number of subkeys
- size_t *pnMaxKeyLen, // max len of subkey name
- size_t *pnValues, // number of values
- size_t *pnMaxValueLen) const;
- // return true if the key is opened
- bool IsOpened() const { return m_hKey != 0; }
- // for "if ( !key ) wxLogError(...)" kind of expressions
- operator bool() const { return m_dwLastError == 0; }
-
- // operations on the key itself
- // explicitly open the key (will be automatically done by all functions
- // which need the key to be opened if the key is not opened yet)
- bool Open(AccessMode mode = Write);
- // create the key: will fail if the key already exists and !bOkIfExists
- bool Create(bool bOkIfExists = true);
- // rename a value from old name to new one
- bool RenameValue(const wxChar *szValueOld, const wxChar *szValueNew);
- // rename the key
- bool Rename(const wxChar *szNewName);
- // copy value to another key possibly changing its name (by default it will
- // remain the same)
- bool CopyValue(const wxChar *szValue, wxRegKey& keyDst,
- const wxChar *szNewName = NULL);
- // copy the entire contents of the key recursively to another location
- bool Copy(const wxChar *szNewName);
- // same as Copy() but using a key and not the name
- bool Copy(wxRegKey& keyDst);
- // close the key (will be automatically done in dtor)
- bool Close();
-
- // deleting keys/values
- // deletes this key and all of it's subkeys/values
- bool DeleteSelf();
- // deletes the subkey with all of it's subkeys/values recursively
- bool DeleteKey(const wxChar *szKey);
- // deletes the named value (may be NULL to remove the default value)
- bool DeleteValue(const wxChar *szValue);
-
- // access to values and subkeys
- // get value type
- ValueType GetValueType(const wxChar *szValue) const;
- // returns true if the value contains a number (else it's some string)
- bool IsNumericValue(const wxChar *szValue) const;
-
- // assignment operators set the default value of the key
- wxRegKey& operator=(const wxString& strValue)
- { SetValue(NULL, strValue); return *this; }
-
- // query the default value of the key: implicitly or explicitly
- wxString QueryDefaultValue() const;
- operator wxString() const { return QueryDefaultValue(); }
-
- // named values
-
- // set the string value
- bool SetValue(const wxChar *szValue, const wxString& strValue);
- // retrieve the string value
- bool QueryValue(const wxChar *szValue, wxString& strValue) const
- { return QueryValue(szValue, strValue, false); }
- // retrieve raw string value
- bool QueryRawValue(const wxChar *szValue, wxString& strValue) const
- { return QueryValue(szValue, strValue, true); }
- // retrieve either raw or expanded string value
- bool QueryValue(const wxChar *szValue, wxString& strValue, bool raw) const;
-
- // query existence of a key/value
- // return true if value exists
- bool HasValue(const wxChar *szKey) const;
- // return true if given subkey exists
- bool HasSubKey(const wxChar *szKey) const;
- // return true if any subkeys exist
- bool HasSubkeys() const;
- // return true if any values exist
- bool HasValues() const;
- // return true if the key is empty (nothing under this key)
- bool IsEmpty() const { return !HasSubkeys() && !HasValues(); }
-
- // enumerate values and subkeys
- bool GetFirstValue(wxString& strValueName, long& lIndex);
- bool GetNextValue (wxString& strValueName, long& lIndex) const;
-
- bool GetFirstKey (wxString& strKeyName , long& lIndex);
- bool GetNextKey (wxString& strKeyName , long& lIndex) const;
-
- // for wxRegConfig usage only: preallocate some memory for the name
- void ReserveMemoryForName(size_t bytes) { m_strKey.reserve(bytes); }
-
-private:
- // common part of all ctors
- void Init()
- {
- m_hKey = (WXHKEY) NULL;
- m_dwLastError = 0;
- }
-
- // no copy ctor/assignment operator
- wxRegKey(const wxRegKey& key); // not implemented
- wxRegKey& operator=(const wxRegKey& key); // not implemented
-
- WXHKEY m_hKey, // our handle
- m_hRootKey; // handle of the top key (i.e. StdKey)
- wxString m_strKey; // key name (relative to m_hRootKey)
-
- long m_dwLastError; // last error (0 if none)
-};
-
-#endif //_REGISTRY_H
-
// See also wxUSE_CONFIG_NATIVE below.
//
// Recommended setting: 1
-#define wxUSE_CONFIG 0
+#define wxUSE_CONFIG 1
// If wxUSE_CONFIG is 1, you may choose to use either the native config
// classes under Windows (using .INI files under Win16 and the registry under
// not wxFileConfig.
//
// Recommended setting: 1
-#define wxUSE_CONFIG_NATIVE 0
+#define wxUSE_CONFIG_NATIVE 1
// If wxUSE_DIALUP_MANAGER is 1, compile in wxDialUpManager class which allows
// to connect/disconnect from the network and be notified whenever the dial-up
// that use the connection) should support forward only scrolling of cursors,
// or both forward and backward support for backward scrolling cursors is
// dependent on the data source as well as the ODBC driver being used.
-#define wxODBC_FWD_ONLY_CURSORS 0
+#define wxODBC_FWD_ONLY_CURSORS 0
// Default is 0. Set to 1 to use the deprecated classes, enum types, function,
// member variables. With a setting of 1, full backward compatability with the
ms_pConfig =
#if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE
new wxRegConfig(wxTheApp->GetAppName(), wxTheApp->GetVendorName());
+ #elif defined(__WXPALMOS__) && wxUSE_CONFIG_NATIVE
+ new wxPrefConfig(wxTheApp->GetAppName());
#else // either we're under Unix or wish to use files even under Windows
new wxFileConfig(wxTheApp->GetAppName());
#endif
+++ /dev/null
-///////////////////////////////////////////////////////////////////////////////
-// Name: src/palmos/iniconf.cpp
-// Purpose: implementation of wxIniConfig class
-// Author: William Osborne
-// Modified by:
-// Created: 10/13/04
-// RCS-ID: $Id:
-// Copyright: (c) William Osborne
-// Licence: wxWindows licence
-///////////////////////////////////////////////////////////////////////////////
-
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "iniconf.h"
-#endif
-
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
- #include "wx/string.h"
- #include "wx/intl.h"
- #include "wx/event.h"
- #include "wx/app.h"
- #include "wx/utils.h"
-#endif //WX_PRECOMP
-
-// Doesn't yet compile in Unicode mode
-
-#if wxUSE_CONFIG && !wxUSE_UNICODE
-
-#include "wx/dynarray.h"
-#include "wx/log.h"
-#include "wx/config.h"
-#include "wx/file.h"
-
-#include "wx/palmos/iniconf.h"
-
-#include "wx/palmos/wrapwin.h"
-
-// ----------------------------------------------------------------------------
-// constants
-// ----------------------------------------------------------------------------
-
-// we replace all path separators with this character
-#define PATH_SEP_REPLACE '_'
-
-// ============================================================================
-// implementation
-// ============================================================================
-
-// ----------------------------------------------------------------------------
-// ctor & dtor
-// ----------------------------------------------------------------------------
-
-wxIniConfig::wxIniConfig(const wxString& strAppName,
- const wxString& strVendor,
- const wxString& localFilename,
- const wxString& globalFilename,
- long style)
- : wxConfigBase(strAppName, strVendor, localFilename, globalFilename, style)
-{
-}
-
-wxIniConfig::~wxIniConfig()
-{
-}
-
-// ----------------------------------------------------------------------------
-// path management
-// ----------------------------------------------------------------------------
-
-void wxIniConfig::SetPath(const wxString& strPath)
-{
-}
-
-const wxString& wxIniConfig::GetPath() const
-{
- static wxString s_str;
-
- return s_str;
-}
-
-wxString wxIniConfig::GetPrivateKeyName(const wxString& szKey) const
-{
- wxString strKey;
-
- return strKey;
-}
-
-wxString wxIniConfig::GetKeyName(const wxString& szKey) const
-{
- wxString strKey;
-
- return strKey;
-}
-
-// ----------------------------------------------------------------------------
-// enumeration
-// ----------------------------------------------------------------------------
-
-bool wxIniConfig::GetFirstGroup(wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const
-{
- return FALSE;
-}
-
-bool wxIniConfig::GetNextGroup (wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const
-{
- return FALSE;
-}
-
-bool wxIniConfig::GetFirstEntry(wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const
-{
- return FALSE;
-}
-
-bool wxIniConfig::GetNextEntry (wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const
-{
- return FALSE;
-}
-
-// ----------------------------------------------------------------------------
-// misc info
-// ----------------------------------------------------------------------------
-
-size_t wxIniConfig::GetNumberOfEntries(bool WXUNUSED(bRecursive)) const
-{
- return (size_t)-1;
-}
-
-size_t wxIniConfig::GetNumberOfGroups(bool WXUNUSED(bRecursive)) const
-{
- return (size_t)-1;
-}
-
-bool wxIniConfig::HasGroup(const wxString& WXUNUSED(strName)) const
-{
- return FALSE;
-}
-
-bool wxIniConfig::HasEntry(const wxString& WXUNUSED(strName)) const
-{
- return FALSE;
-}
-
-// is current group empty?
-bool wxIniConfig::IsEmpty() const
-{
- return TRUE;
-}
-
-// ----------------------------------------------------------------------------
-// read/write
-// ----------------------------------------------------------------------------
-
-bool wxIniConfig::DoReadString(const wxString& szKey, wxString *pstr) const
-{
- return FALSE;
-}
-
-bool wxIniConfig::DoReadLong(const wxString& szKey, long *pl) const
-{
- return FALSE ;
-}
-
-bool wxIniConfig::DoWriteString(const wxString& szKey, const wxString& szValue)
-{
- return FALSE;
-}
-
-bool wxIniConfig::DoWriteLong(const wxString& szKey, long lValue)
-{
- return FALSE;
-}
-
-bool wxIniConfig::Flush(bool /* bCurrentOnly */)
-{
- return FALSE;
-}
-
-// ----------------------------------------------------------------------------
-// delete
-// ----------------------------------------------------------------------------
-
-bool wxIniConfig::DeleteEntry(const wxString& szKey, bool bGroupIfEmptyAlso)
-{
- return FALSE;
-}
-
-bool wxIniConfig::DeleteGroup(const wxString& szKey)
-{
- return FALSE;
-}
-
-#ifndef MAX_PATH
-#define MAX_PATH 256
-#endif
-
-bool wxIniConfig::DeleteAll()
-{
- return FALSE;
-}
-
-bool wxIniConfig::RenameEntry(const wxString& WXUNUSED(oldName),
- const wxString& WXUNUSED(newName))
-{
- return FALSE;
-}
-
-bool wxIniConfig::RenameGroup(const wxString& WXUNUSED(oldName),
- const wxString& WXUNUSED(newName))
-{
- return FALSE;
-}
-
-#endif
- // wxUSE_CONFIG && wxUSE_UNICODE
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// Name: src/palmos/prefconf.cpp
+// Purpose: wxPrefConfig implementation
+// Author: Wlodzimierz ABX Skiba
+// Modified by:
+// Created: 28.12.2004
+// RCS-ID: $Id$
+// Copyright: (c) Wlodzimierz Skiba
+// License: wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+#pragma implementation "prefconf.h"
+#endif
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+ #include "wx/string.h"
+#endif //WX_PRECOMP
+
+#if wxUSE_CONFIG && wxUSE_CONFIG_NATIVE
+
+#include "wx/config.h"
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+/*
+
+http://www.palmos.com/dev/support/docs/protein_books/System_Management/PreferenceConcepts.html
+
+This wxPrefConfig class is a wxConfig wrapper around PalmOS Preferences
+functionality. Preferences allow to write any structure into its database so
+wxPrefConfig writes there all entries of single group into one Preference.
+To optimize read/write operations value of preference is cached. Cache is filled
+after each change of the path (including using path to group names in all
+operations) and it is flushed on destructor, any path change on or purpose
+with Flush().
+
+Meaning of styles:
+
+ wxCONFIG_USE_LOCAL_FILE => store config in "saved" preferences database
+ (not to be backed up during a HotSync operation)
+ wxCONFIG_USE_GLOBAL_FILE => store config in "unsaved" preferences database
+ (backed up during a HotSync operation)
+
+
+Each Preference is an array of chars. First unsigned char describes
+number N of chars used for Preference size. Next N chars (string) contains
+length of rest of Preference. Preference consists in serie of entries which
+should be read in loop until in reaches end of Preference.
+
+ Each entry is an set of chars with following structure:
+ 1. name (null terminated)
+ 2. type (single char): b,s,g,l,d (see value)
+ 3. value
+ - for type="b" (bool) it os "0" or "1"
+ - for type="s" (string) it is null terminated set of chars
+ - for type="g" (subgroup) as for "s" but string is converted to
+ uint16_t for id parameter of ::PrefGetAppPreferences()
+ - for type="l" (long) as for "s" but string is converted to long
+ - for type="d" (double) as for "s" but string is converted to double
+ - otherwise it is ""
+
+So all together first Read in group needs 3 reading from Preference:
+ 1. take the length N of length
+ 2. take the length M of the group content
+ 3. take the group content
+and all it is in single Preference to not overload Preferences database.
+As long as each next Read/Write is performed in the same group then none
+access to Preferences is performed. Flushing needs only single writing to
+databease because all 3 parts of Preference can be prepared in memory.
+
+NOTE: wxPrefConfig can read/write only its own entries. It is impossible to
+know structures of Preferences of other non wxW applications.
+
+*/
+
+// ----------------------------------------------------------------------------
+// ctor/dtor
+// ----------------------------------------------------------------------------
+
+wxPrefConfig::wxPrefConfig(const wxString& appName, const wxString& vendorName,
+ const wxString& strLocal, const wxString& strGlobal,
+ long style)
+ : wxConfigBase(appName, vendorName, strLocal, strGlobal, style)
+{
+}
+
+// ----------------------------------------------------------------------------
+// path management
+// ----------------------------------------------------------------------------
+
+void wxPrefConfig::SetPath(const wxString& strPath)
+{
+}
+
+// ----------------------------------------------------------------------------
+// enumeration (works only with current group)
+// ----------------------------------------------------------------------------
+
+bool wxPrefConfig::GetFirstGroup(wxString& str, long& lIndex) const
+{
+}
+
+bool wxPrefConfig::GetNextGroup(wxString& str, long& lIndex) const
+{
+ /* TODO */
+ return false;
+}
+
+bool wxPrefConfig::GetFirstEntry(wxString& str, long& lIndex) const
+{
+ /* TODO */
+ return false;
+}
+
+bool wxPrefConfig::GetNextEntry(wxString& str, long& lIndex) const
+{
+ /* TODO */
+ return false;
+}
+
+size_t wxPrefConfig::GetNumberOfEntries(bool WXUNUSED(bRecursive)) const
+{
+ /* TODO */
+ return 0;
+}
+
+size_t wxPrefConfig::GetNumberOfGroups(bool WXUNUSED(bRecursive)) const
+{
+ /* TODO */
+ return 0;
+}
+
+// ----------------------------------------------------------------------------
+// tests for existence
+// ----------------------------------------------------------------------------
+
+bool wxPrefConfig::HasGroup(const wxString& key) const
+{
+ /* TODO */
+ return false;
+}
+
+bool wxPrefConfig::HasEntry(const wxString& key) const
+{
+ /* TODO */
+ return false;
+}
+
+wxConfigBase::EntryType wxPrefConfig::GetEntryType(const wxString& key) const
+{
+ /* TODO */
+ return wxConfigBase::Type_Unknown;
+}
+
+// ----------------------------------------------------------------------------
+// reading/writing
+// ----------------------------------------------------------------------------
+
+bool wxPrefConfig::DoReadString(const wxString& key, wxString *pStr) const
+{
+ /* TODO */
+ return false;
+}
+
+// this exactly reproduces the string version above except for ExpandEnvVars(),
+// we really should avoid this code duplication somehow...
+
+bool wxPrefConfig::DoReadLong(const wxString& key, long *plResult) const
+{
+ /* TODO */
+ return false;
+}
+
+bool wxPrefConfig::DoWriteString(const wxString& key, const wxString& szValue)
+{
+ /* TODO */
+ return false;
+}
+
+bool wxPrefConfig::DoWriteLong(const wxString& key, long lValue)
+{
+ /* TODO */
+ return false;
+}
+
+// ----------------------------------------------------------------------------
+// renaming
+// ----------------------------------------------------------------------------
+
+bool wxPrefConfig::RenameEntry(const wxString& oldName, const wxString& newName)
+{
+ /* TODO */
+ return false;
+}
+
+bool wxPrefConfig::RenameGroup(const wxString& oldName, const wxString& newName)
+{
+ /* TODO */
+ return false;
+}
+
+// ----------------------------------------------------------------------------
+// deleting
+// ----------------------------------------------------------------------------
+
+bool wxPrefConfig::DeleteEntry(const wxString& value, bool bGroupIfEmptyAlso)
+{
+ /* TODO */
+ return false;
+}
+
+bool wxPrefConfig::DeleteGroup(const wxString& key)
+{
+ /* TODO */
+ return false;
+}
+
+bool wxPrefConfig::DeleteAll()
+{
+ /* TODO */
+ return false;
+}
+
+#endif // wxUSE_CONFIG && wxUSE_CONFIG_NATIVE
+++ /dev/null
-///////////////////////////////////////////////////////////////////////////////
-// Name: palmos/regconf.cpp
-// Purpose:
-// Author: William Osborne
-// Modified by:
-// Created: 10/13/04
-// RCS-ID: $Id:
-// Copyright: (c) William Osborne
-// Licence: wxWindows licence
-///////////////////////////////////////////////////////////////////////////////
-
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "regconf.h"
-#endif
-
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
- #include "wx/string.h"
- #include "wx/intl.h"
-#endif //WX_PRECOMP
-
-#include "wx/event.h"
-#include "wx/app.h"
-#include "wx/log.h"
-
-#if wxUSE_CONFIG
-
-#include "wx/config.h"
-
-#include "wx/palmos/registry.h"
-#include "wx/palmos/regconf.h"
-
-// ----------------------------------------------------------------------------
-// constants
-// ----------------------------------------------------------------------------
-
-// we put our data in HKLM\SOFTWARE_KEY\appname
-#define SOFTWARE_KEY wxString(wxT("Software\\"))
-
-// ----------------------------------------------------------------------------
-// global functions
-// ----------------------------------------------------------------------------
-
-// get the value if the key is opened and it exists
-bool TryGetValue(const wxRegKey& key, const wxString& str, wxString& strVal)
-{
- return false;
-}
-
-bool TryGetValue(const wxRegKey& key, const wxString& str, long *plVal)
-{
- return false;
-}
-
-// ============================================================================
-// implementation
-// ============================================================================
-
-// ----------------------------------------------------------------------------
-// ctor/dtor
-// ----------------------------------------------------------------------------
-
-// create the config object which stores its data under HKCU\vendor\app and, if
-// style & wxCONFIG_USE_GLOBAL_FILE, under HKLM\vendor\app
-wxRegConfig::wxRegConfig(const wxString& appName, const wxString& vendorName,
- const wxString& strLocal, const wxString& strGlobal,
- long style)
- : wxConfigBase(appName, vendorName, strLocal, strGlobal, style)
-{
-}
-
-wxRegConfig::~wxRegConfig()
-{
-}
-
-// ----------------------------------------------------------------------------
-// path management
-// ----------------------------------------------------------------------------
-
-void wxRegConfig::SetPath(const wxString& strPath)
-{
-}
-
-// ----------------------------------------------------------------------------
-// enumeration (works only with current group)
-// ----------------------------------------------------------------------------
-
-#define LOCAL_MASK 0x8000
-#define IS_LOCAL_INDEX(l) (((l) & LOCAL_MASK) != 0)
-
-bool wxRegConfig::GetFirstGroup(wxString& str, long& lIndex) const
-{
- return false;
-}
-
-bool wxRegConfig::GetNextGroup(wxString& str, long& lIndex) const
-{
- return false;
-}
-
-bool wxRegConfig::GetFirstEntry(wxString& str, long& lIndex) const
-{
- return false;
-}
-
-bool wxRegConfig::GetNextEntry(wxString& str, long& lIndex) const
-{
- return false;
-}
-
-size_t wxRegConfig::GetNumberOfEntries(bool WXUNUSED(bRecursive)) const
-{
- return 0;
-}
-
-size_t wxRegConfig::GetNumberOfGroups(bool WXUNUSED(bRecursive)) const
-{
- return 0;
-}
-
-// ----------------------------------------------------------------------------
-// tests for existence
-// ----------------------------------------------------------------------------
-
-bool wxRegConfig::HasGroup(const wxString& key) const
-{
- return false;
-}
-
-bool wxRegConfig::HasEntry(const wxString& key) const
-{
- return false;
-}
-
-wxConfigBase::EntryType wxRegConfig::GetEntryType(const wxString& key) const
-{
- return wxConfigBase::Type_Integer;
-}
-
-// ----------------------------------------------------------------------------
-// reading/writing
-// ----------------------------------------------------------------------------
-
-bool wxRegConfig::DoReadString(const wxString& key, wxString *pStr) const
-{
- return FALSE;
-}
-
-// this exactly reproduces the string version above except for ExpandEnvVars(),
-// we really should avoid this code duplication somehow...
-
-bool wxRegConfig::DoReadLong(const wxString& key, long *plResult) const
-{
- return FALSE;
-}
-
-bool wxRegConfig::DoWriteString(const wxString& key, const wxString& szValue)
-{
- return false;
-}
-
-bool wxRegConfig::DoWriteLong(const wxString& key, long lValue)
-{
- return false;
-}
-
-// ----------------------------------------------------------------------------
-// renaming
-// ----------------------------------------------------------------------------
-
-bool wxRegConfig::RenameEntry(const wxString& oldName, const wxString& newName)
-{
- return false;
-}
-
-bool wxRegConfig::RenameGroup(const wxString& oldName, const wxString& newName)
-{
- return false;
-}
-
-// ----------------------------------------------------------------------------
-// deleting
-// ----------------------------------------------------------------------------
-
-bool wxRegConfig::DeleteEntry(const wxString& value, bool bGroupIfEmptyAlso)
-{
- return false;
-}
-
-bool wxRegConfig::DeleteGroup(const wxString& key)
-{
- return false;
-}
-
-bool wxRegConfig::DeleteAll()
-{
- return false;
-}
-
-#endif
- // wxUSE_CONFIG
#else // !wxUSE_FONTMAP
-#include "wx/palmos/registry.h"
-
// this should work if Internet Exploiter is installed
extern long wxCharsetToCodepage(const wxChar *name)
{