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.

60 lines
2.4 KiB

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 (C) 2014 KiCad Developers, see CHANGELOG.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. //IMPLEMENT_DYNAMIC_CLASS( KIWAY_EXPRESS, wxEvent )
  26. #if 0 // requires that this code reside in only a single link image, rather than
  27. // in each of kicad.exe, _pcbnew.kiface, and _eeschema.kiface as now.
  28. // In the current case wxEVENT_ID will get a different value in each link
  29. // image. We need to put this into a shared library for common utilization,
  30. // I think that library should be libki.so. I am reluctant to do that now
  31. // because the cost will be finding libki.so at runtime, and we need infrastructure
  32. // to set our LIB_ENV_VAR to the proper place so libki.so can be reliably found.
  33. // All things in due course.
  34. const wxEventType KIWAY_EXPRESS::wxEVENT_ID = wxNewEventType();
  35. #else
  36. const wxEventType KIWAY_EXPRESS::wxEVENT_ID = 30000; // commmon accross all link images, hopefully unique.
  37. #endif
  38. KIWAY_EXPRESS::KIWAY_EXPRESS( const KIWAY_EXPRESS& anOther ) :
  39. wxEvent( anOther )
  40. {
  41. m_destination = anOther.m_destination;
  42. m_payload = anOther.m_payload;
  43. }
  44. KIWAY_EXPRESS::KIWAY_EXPRESS( FRAME_T aDestination, MAIL_T aCommand,
  45. const std::string& aPayload, wxWindow* aSource ) :
  46. wxEvent( aCommand, wxEVENT_ID ),
  47. m_destination( aDestination ),
  48. m_payload( aPayload )
  49. {
  50. SetEventObject( aSource );
  51. }