sharedminibrowser.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "precomp.h"
  2. #include "sharedminibrowser.h"
  3. #include "wnds/skinwnd.h"
  4. #include "../studio/api.h"
  5. #include "../common/mainminibrowser.h"
  6. void SharedMiniBrowser::navigateUrl(const char *url) {
  7. if (!m_monitor) {
  8. m_monitor = new SkinMonitor();
  9. }
  10. if (!MainMiniBrowser::getScriptObject()) {
  11. if (!m_inserted) {
  12. String xml = "buf:\n";
  13. xml += "<WinampAbstractionLayer>\n";
  14. xml += " <groupdef id=\"addon.shared.minibrowser\" name=\"MiniBrowser\">\n";
  15. xml += " <browser mainmb=\"1\" x=\"0\" y=\"0\" w=\"0\" h=\"0\" relatw=\"1\" relath=\"1\" />\n";
  16. xml += " </groupdef>\n";
  17. xml += "</WinampAbstractionLayer>\n";
  18. WASABI_API_SKIN->loadSkinFile(xml);
  19. m_inserted = 1;
  20. }
  21. SkinWnd("addon.shared.minibrowser", WASABISTDCONTAINER_RESIZABLE_NOSTATUS);
  22. ASSERTPR(MainMiniBrowser::getScriptObject() != NULL, "Something is really wrong with wasabi");
  23. }
  24. MainMiniBrowser::navigateUrl(url);
  25. MainMiniBrowser::popMb();
  26. }
  27. void SharedMiniBrowser::shutdown() {
  28. if (m_monitor) delete m_monitor;
  29. m_monitor = NULL;
  30. }
  31. int SharedMiniBrowser::m_inserted = 0;
  32. SkinMonitor *SharedMiniBrowser::m_monitor = NULL;