Structs.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. // Permission is hereby granted, free of charge, to any person obtaining
  2. // a copy of this software and associated documentation files (the
  3. // "Software",, to deal in the Software without restriction, including
  4. // without limitation the rights to use, copy, modify, merge, publish,
  5. // distribute, sublicense, and/or sell copies of the Software, and to
  6. // permit persons to whom the Software is furnished to do so, subject to
  7. // the following conditions:
  8. //
  9. // The above copyright notice and this permission notice shall be
  10. // included in all copies or substantial portions of the Software.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  13. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  15. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  16. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  17. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  18. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  19. //
  20. // Copyright (c) 2007 Novell, Inc.
  21. //
  22. // Authors:
  23. // Geoff Norton <[email protected]>
  24. //
  25. using System;
  26. namespace System.Windows.Forms.CarbonInternal {
  27. internal struct CGSize {
  28. public float width;
  29. public float height;
  30. public CGSize (int w, int h) {
  31. this.width = (float)w;
  32. this.height = (float)h;
  33. }
  34. }
  35. internal struct QDPoint {
  36. public short y;
  37. public short x;
  38. public QDPoint (short x, short y) {
  39. this.x = x;
  40. this.y = y;
  41. }
  42. }
  43. internal struct CGPoint {
  44. public float x;
  45. public float y;
  46. public CGPoint (int x, int y) {
  47. this.x = (float)x;
  48. this.y = (float)y;
  49. }
  50. }
  51. internal struct HIRect {
  52. public CGPoint origin;
  53. public CGSize size;
  54. public HIRect (int x, int y, int w, int h) {
  55. this.origin = new CGPoint (x, y);
  56. this.size = new CGSize (w, h);
  57. }
  58. }
  59. internal struct HIViewID {
  60. public uint type;
  61. public uint id;
  62. public HIViewID (uint type, uint id) {
  63. this.type = type;
  64. this.id = id;
  65. }
  66. }
  67. internal struct EventTypeSpec {
  68. public UInt32 eventClass;
  69. public UInt32 eventKind;
  70. public EventTypeSpec (UInt32 eventClass, UInt32 eventKind)
  71. {
  72. this.eventClass = eventClass;
  73. this.eventKind = eventKind;
  74. }
  75. }
  76. internal struct CarbonEvent {
  77. public IntPtr hWnd;
  78. public IntPtr evt;
  79. public CarbonEvent (IntPtr hWnd, IntPtr evt)
  80. {
  81. this.hWnd = hWnd;
  82. this.evt = evt;
  83. }
  84. }
  85. internal struct RGBColor {
  86. public short red;
  87. public short green;
  88. public short blue;
  89. }
  90. internal struct Rect {
  91. public short top;
  92. public short left;
  93. public short bottom;
  94. public short right;
  95. }
  96. internal struct Caret {
  97. internal Timer Timer;
  98. internal IntPtr Hwnd;
  99. internal int X;
  100. internal int Y;
  101. internal int Width;
  102. internal int Height;
  103. internal int Visible;
  104. internal bool On;
  105. internal bool Paused;
  106. }
  107. internal struct Hover {
  108. internal Timer Timer;
  109. internal IntPtr Hwnd;
  110. internal int X;
  111. internal int Y;
  112. internal int Interval;
  113. }
  114. internal struct CGAffineTransform {
  115. internal float a;
  116. internal float b;
  117. internal float c;
  118. internal float d;
  119. internal float tx;
  120. internal float ty;
  121. }
  122. internal struct MouseTrackingRegionID {
  123. public uint signature;
  124. public uint id;
  125. public MouseTrackingRegionID (uint signature, uint id) {
  126. this.signature = signature;
  127. this.id = id;
  128. }
  129. }
  130. internal struct ProcessSerialNumber {
  131. public ulong highLongOfPSN;
  132. public ulong lowLongOfPSN;
  133. }
  134. }