You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.5 KiB

12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
  5. * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. #include <kiway_express.h>
  25. #include <wx/window.h>
  26. //IMPLEMENT_DYNAMIC_CLASS( KIWAY_EXPRESS, wxEvent )
  27. #if 0 // requires that this code reside in only a single link image, rather than
  28. // in each of kicad.exe, _pcbnew.kiface, and _eeschema.kiface as now.
  29. // In the current case wxEVENT_ID will get a different value in each link
  30. // image. We need to put this into a shared library for common utilization,
  31. // I think that library should be libki.so. I am reluctant to do that now
  32. // because the cost will be finding libki.so at runtime, and we need infrastructure
  33. // to set our LIB_ENV_VAR to the proper place so libki.so can be reliably found.
  34. // All things in due course.
  35. const wxEventType KIWAY_EXPRESS::wxEVENT_ID = wxNewEventType();
  36. #else
  37. const wxEventType KIWAY_EXPRESS::wxEVENT_ID = 30000; // common across all link images,
  38. // hopefully unique.
  39. #endif
  40. KIWAY_EXPRESS::KIWAY_EXPRESS( const KIWAY_EXPRESS& anOther ) :
  41. wxEvent( anOther ),
  42. m_destination( anOther.m_destination ),
  43. m_payload( anOther.m_payload )
  44. {
  45. }
  46. KIWAY_EXPRESS::KIWAY_EXPRESS( FRAME_T aDestination, MAIL_T aCommand, std::string& aPayload,
  47. wxWindow* aSource ) :
  48. wxEvent( aCommand, wxEVENT_ID ),
  49. m_destination( aDestination ),
  50. m_payload( aPayload )
  51. {
  52. SetEventObject( aSource );
  53. }