1
0

InternetConfigGroup.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /** (c) Nullsoft, Inc. C O N F I D E N T I A L
  2. ** Filename:
  3. ** Project:
  4. ** Description:
  5. ** Author: Ben Allison [email protected]
  6. ** Created:
  7. **/
  8. #include "main.h"
  9. #include "InternetConfigGroup.h"
  10. #include "../Agave/Config/ifc_configitem.h"
  11. #include "WinampAttributes.h"
  12. #include "../nu/ns_wc.h"
  13. class ProxyConfigItem : public ifc_configitem
  14. {
  15. public:
  16. const wchar_t *GetString()
  17. {
  18. static wchar_t blah[256];
  19. if (config_proxy[0])
  20. MultiByteToWideCharSZ(CP_ACP, 0, config_proxy, -1, blah, 256);
  21. else
  22. return 0;
  23. return blah;
  24. }
  25. protected:
  26. RECVS_DISPATCH;
  27. };
  28. #define CBCLASS ProxyConfigItem
  29. START_DISPATCH;
  30. CB(IFC_CONFIGITEM_GETSTRING, GetString)
  31. END_DISPATCH;
  32. #undef CBCLASS
  33. static ProxyConfigItem proxyConfigItem;
  34. ifc_configitem *InternetConfigGroup::GetItem(const wchar_t *name)
  35. {
  36. if (!wcscmp(name, L"proxy"))
  37. return &proxyConfigItem;
  38. else if (!wcscmp(name, L"proxy80"))
  39. return &config_proxy80;
  40. return 0;
  41. }
  42. #define CBCLASS InternetConfigGroup
  43. START_DISPATCH;
  44. CB(IFC_CONFIGGROUP_GETITEM, GetItem)
  45. CB(IFC_CONFIGGROUP_GETGUID, GetGUID)
  46. END_DISPATCH;
  47. #undef CBCLASS