modei.inc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {
  2. Free Pascal port of the OpenPTC C++ library.
  3. Copyright (C) 2001-2003 Nikolay Nikolov ([email protected])
  4. Original C++ version by Glenn Fiedler ([email protected])
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. }
  17. Constructor TPTCMode.Create;
  18. Begin
  19. m_format := Nil;
  20. m_format := TPTCFormat.Create;
  21. m_valid := False;
  22. m_width := 0;
  23. m_height := 0;
  24. End;
  25. Constructor TPTCMode.Create(_width, _height : Integer; Const _format : TPTCFormat);
  26. Begin
  27. m_format := Nil;
  28. m_valid := True;
  29. m_width := _width;
  30. m_height := _height;
  31. m_format := TPTCFormat.Create(_format);
  32. End;
  33. Constructor TPTCMode.Create(Const mode : TPTCMode);
  34. Begin
  35. m_format := Nil;
  36. m_format := TPTCFormat.Create;
  37. ASSign(mode);
  38. End;
  39. Destructor TPTCMode.Destroy;
  40. Begin
  41. m_format.Free;
  42. Inherited Destroy;
  43. End;
  44. Procedure TPTCMode.Assign(Const mode : TPTCMode);
  45. Begin
  46. If Self = mode Then
  47. Raise TPTCError.Create('self assignment is not allowed');
  48. m_valid := mode.valid;
  49. m_width := mode.width;
  50. m_height := mode.height;
  51. m_format.ASSign(mode.format);
  52. End;
  53. Function TPTCMode.Equals(Const mode : TPTCMode) : Boolean;
  54. Begin
  55. Equals := (m_valid = mode.m_valid) And
  56. (m_width = mode.m_width) And
  57. (m_height = mode.m_height) And
  58. m_format.Equals(mode.m_format);
  59. End;