reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 1 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 2 | * Copyright 2006 The Android Open Source Project |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 3 | * |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef SkEvent_DEFINED |
| 9 | #define SkEvent_DEFINED |
| 10 | |
| 11 | #include "SkDOM.h" |
| 12 | #include "SkMetaData.h" |
| 13 | #include "SkString.h" |
| 14 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 15 | /** Unique 32bit id used to identify an instance of SkEventSink. When events are |
| 16 | posted, they are posted to a specific sinkID. When it is time to dispatch the |
| 17 | event, the sinkID is used to find the specific SkEventSink object. If it is found, |
| 18 | its doEvent() method is called with the event. |
| 19 | */ |
| 20 | typedef uint32_t SkEventSinkID; |
| 21 | |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 22 | /** |
| 23 | * \class SkEvent |
| 24 | * |
| 25 | * When an event is dispatched from the event queue, it is either sent to |
| 26 | * the eventsink matching the target ID (if not 0), or the target proc is |
| 27 | * called (if not NULL). |
| 28 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 29 | class SkEvent { |
| 30 | public: |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 31 | /** |
| 32 | * Function pointer that takes an event, returns true if it "handled" it. |
| 33 | */ |
| 34 | typedef bool (*Proc)(const SkEvent& evt); |
| 35 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 36 | SkEvent(); |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 37 | explicit SkEvent(const SkString& type, SkEventSinkID = 0); |
| 38 | explicit SkEvent(const char type[], SkEventSinkID = 0); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 39 | SkEvent(const SkEvent& src); |
| 40 | ~SkEvent(); |
| 41 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 42 | /** Copy the event's type into the specified SkString parameter */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 43 | void getType(SkString* str) const; |
| 44 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 45 | /** Returns true if the event's type matches exactly the specified type (case sensitive) */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 46 | bool isType(const SkString& str) const; |
| 47 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 48 | /** Returns true if the event's type matches exactly the specified type (case sensitive) */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 49 | bool isType(const char type[], size_t len = 0) const; |
| 50 | |
| 51 | /** |
| 52 | * Set the event's type to the specified string. |
| 53 | */ |
| 54 | void setType(const SkString&); |
| 55 | |
| 56 | /** |
| 57 | * Set the event's type to the specified string. |
| 58 | */ |
| 59 | void setType(const char type[], size_t len = 0); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 60 | |
reed@google.com | c514dde | 2011-08-03 19:41:24 +0000 | [diff] [blame] | 61 | /** |
| 62 | * Return the target ID, or 0 if there is none. |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 63 | * |
| 64 | * When an event is dispatched from the event queue, it is either sent to |
| 65 | * the eventsink matching the targetID (if not 0), or the target proc is |
| 66 | * called (if not NULL). |
reed@google.com | c514dde | 2011-08-03 19:41:24 +0000 | [diff] [blame] | 67 | */ |
| 68 | SkEventSinkID getTargetID() const { return fTargetID; } |
| 69 | |
| 70 | /** |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 71 | * Set the target ID for this event. 0 means none. Calling this will |
| 72 | * automatically clear the targetProc to null. |
| 73 | * |
| 74 | * When an event is dispatched from the event queue, it is either sent to |
| 75 | * the eventsink matching the targetID (if not 0), or the target proc is |
| 76 | * called (if not NULL). |
reed@google.com | c514dde | 2011-08-03 19:41:24 +0000 | [diff] [blame] | 77 | */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 78 | SkEvent* setTargetID(SkEventSinkID targetID) { |
| 79 | fTargetProc = NULL; |
| 80 | fTargetID = targetID; |
| 81 | return this; |
| 82 | } |
reed@google.com | c514dde | 2011-08-03 19:41:24 +0000 | [diff] [blame] | 83 | |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 84 | /** |
| 85 | * Return the target proc, or NULL if it has none. |
| 86 | * |
| 87 | * When an event is dispatched from the event queue, it is either sent to |
| 88 | * the eventsink matching the targetID (if not 0), or the target proc is |
| 89 | * called (if not NULL). |
| 90 | */ |
| 91 | Proc getTargetProc() const { return fTargetProc; } |
| 92 | |
| 93 | /** |
| 94 | * Set the target ID for this event. NULL means none. Calling this will |
| 95 | * automatically clear the targetID to 0. |
| 96 | * |
| 97 | * When an event is dispatched from the event queue, it is either sent to |
| 98 | * the eventsink matching the targetID (if not 0), or the target proc is |
| 99 | * called (if not NULL). |
| 100 | */ |
| 101 | SkEvent* setTargetProc(Proc proc) { |
| 102 | fTargetID = 0; |
| 103 | fTargetProc = proc; |
| 104 | return this; |
| 105 | } |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 106 | |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 107 | /** |
| 108 | * Return the event's unnamed 32bit field. Default value is 0 |
| 109 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 110 | uint32_t getFast32() const { return f32; } |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 111 | |
| 112 | /** |
| 113 | * Set the event's unnamed 32bit field. |
| 114 | */ |
| 115 | void setFast32(uint32_t x) { f32 = x; } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 116 | |
| 117 | /** Return true if the event contains the named 32bit field, and return the field |
| 118 | in value (if value is non-null). If there is no matching named field, return false |
| 119 | and ignore the value parameter. |
| 120 | */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 121 | bool findS32(const char name[], int32_t* value = NULL) const { return fMeta.findS32(name, value); } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 122 | /** Return true if the event contains the named SkScalar field, and return the field |
| 123 | in value (if value is non-null). If there is no matching named field, return false |
| 124 | and ignore the value parameter. |
| 125 | */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 126 | bool findScalar(const char name[], SkScalar* value = NULL) const { return fMeta.findScalar(name, value); } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 127 | /** Return true if the event contains the named SkScalar field, and return the fields |
| 128 | in value[] (if value is non-null), and return the number of SkScalars in count (if count is non-null). |
| 129 | If there is no matching named field, return false and ignore the value and count parameters. |
| 130 | */ |
| 131 | const SkScalar* findScalars(const char name[], int* count, SkScalar values[] = NULL) const { return fMeta.findScalars(name, count, values); } |
| 132 | /** Return the value of the named string field, or if no matching named field exists, return null. |
| 133 | */ |
| 134 | const char* findString(const char name[]) const { return fMeta.findString(name); } |
| 135 | /** Return true if the event contains the named pointer field, and return the field |
| 136 | in value (if value is non-null). If there is no matching named field, return false |
| 137 | and ignore the value parameter. |
| 138 | */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 139 | bool findPtr(const char name[], void** value) const { return fMeta.findPtr(name, value); } |
| 140 | bool findBool(const char name[], bool* value) const { return fMeta.findBool(name, value); } |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 141 | const void* findData(const char name[], size_t* byteCount = NULL) const { |
| 142 | return fMeta.findData(name, byteCount); |
| 143 | } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 144 | |
| 145 | /** Returns true if ethe event contains the named 32bit field, and if it equals the specified value */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 146 | bool hasS32(const char name[], int32_t value) const { return fMeta.hasS32(name, value); } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 147 | /** Returns true if ethe event contains the named SkScalar field, and if it equals the specified value */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 148 | bool hasScalar(const char name[], SkScalar value) const { return fMeta.hasScalar(name, value); } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 149 | /** Returns true if ethe event contains the named string field, and if it equals (using strcmp) the specified value */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 150 | bool hasString(const char name[], const char value[]) const { return fMeta.hasString(name, value); } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 151 | /** Returns true if ethe event contains the named pointer field, and if it equals the specified value */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 152 | bool hasPtr(const char name[], void* value) const { return fMeta.hasPtr(name, value); } |
| 153 | bool hasBool(const char name[], bool value) const { return fMeta.hasBool(name, value); } |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 154 | bool hasData(const char name[], const void* data, size_t byteCount) const { |
| 155 | return fMeta.hasData(name, data, byteCount); |
| 156 | } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 157 | |
| 158 | /** Add/replace the named 32bit field to the event. In XML use the subelement <data name=... s32=... /> */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 159 | void setS32(const char name[], int32_t value) { fMeta.setS32(name, value); } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 160 | /** Add/replace the named SkScalar field to the event. In XML use the subelement <data name=... scalar=... /> */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 161 | void setScalar(const char name[], SkScalar value) { fMeta.setScalar(name, value); } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 162 | /** Add/replace the named SkScalar[] field to the event. */ |
| 163 | SkScalar* setScalars(const char name[], int count, const SkScalar values[] = NULL) { return fMeta.setScalars(name, count, values); } |
| 164 | /** Add/replace the named string field to the event. In XML use the subelement <data name=... string=... */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 165 | void setString(const char name[], const SkString& value) { fMeta.setString(name, value.c_str()); } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 166 | /** Add/replace the named string field to the event. In XML use the subelement <data name=... string=... */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 167 | void setString(const char name[], const char value[]) { fMeta.setString(name, value); } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 168 | /** Add/replace the named pointer field to the event. There is no XML equivalent for this call */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 169 | void setPtr(const char name[], void* value) { fMeta.setPtr(name, value); } |
| 170 | void setBool(const char name[], bool value) { fMeta.setBool(name, value); } |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 171 | void setData(const char name[], const void* data, size_t byteCount) { |
| 172 | fMeta.setData(name, data, byteCount); |
| 173 | } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 174 | |
| 175 | /** Return the underlying metadata object */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 176 | SkMetaData& getMetaData() { return fMeta; } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 177 | /** Return the underlying metadata object */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 178 | const SkMetaData& getMetaData() const { return fMeta; } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 179 | |
| 180 | /** Call this to initialize the event from the specified XML node */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 181 | void inflate(const SkDOM&, const SkDOM::Node*); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 182 | |
| 183 | SkDEBUGCODE(void dump(const char title[] = NULL);) |
| 184 | |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 185 | /////////////////////////////////////////////////////////////////////////// |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 186 | |
reed@google.com | c514dde | 2011-08-03 19:41:24 +0000 | [diff] [blame] | 187 | /** |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 188 | * Post to the event queue using the event's targetID or target-proc. |
| 189 | * |
| 190 | * The event must be dynamically allocated, as ownership is transferred to |
| 191 | * the event queue. It cannot be allocated on the stack or in a global. |
reed@google.com | c514dde | 2011-08-03 19:41:24 +0000 | [diff] [blame] | 192 | */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 193 | void post() { |
reed@google.com | c514dde | 2011-08-03 19:41:24 +0000 | [diff] [blame] | 194 | return this->postDelay(0); |
| 195 | } |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 196 | |
reed@google.com | c514dde | 2011-08-03 19:41:24 +0000 | [diff] [blame] | 197 | /** |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 198 | * Post to the event queue using the event's targetID or target-proc and |
| 199 | * the specifed millisecond delay. |
| 200 | * |
| 201 | * The event must be dynamically allocated, as ownership is transferred to |
| 202 | * the event queue. It cannot be allocated on the stack or in a global. |
reed@google.com | c514dde | 2011-08-03 19:41:24 +0000 | [diff] [blame] | 203 | */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 204 | void postDelay(SkMSec delay); |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 205 | |
reed@google.com | c514dde | 2011-08-03 19:41:24 +0000 | [diff] [blame] | 206 | /** |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 207 | * Post to the event queue using the event's targetID or target-proc. |
| 208 | * The event will be delivered no sooner than the specified millisecond |
| 209 | * time, as measured by SkTime::GetMSecs(). |
| 210 | * |
| 211 | * The event must be dynamically allocated, as ownership is transferred to |
| 212 | * the event queue. It cannot be allocated on the stack or in a global. |
reed@google.com | c514dde | 2011-08-03 19:41:24 +0000 | [diff] [blame] | 213 | */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 214 | void postTime(SkMSec time); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 215 | |
| 216 | /////////////////////////////////////////////// |
| 217 | /** Porting layer must call these functions **/ |
| 218 | /////////////////////////////////////////////// |
| 219 | |
| 220 | /** Global initialization function for the SkEvent system. Should be called exactly |
| 221 | once before any other event method is called, and should be called after the |
| 222 | call to SkGraphics::Init(). |
| 223 | */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 224 | static void Init(); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 225 | /** Global cleanup function for the SkEvent system. Should be called exactly once after |
| 226 | all event methods have been called, and should be called before calling SkGraphics::Term(). |
| 227 | */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 228 | static void Term(); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 229 | |
| 230 | /** Call this to process one event from the queue. If it returns true, there are more events |
| 231 | to process. |
| 232 | */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 233 | static bool ProcessEvent(); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 234 | /** Call this whenever the requested timer has expired (requested by a call to SetQueueTimer). |
| 235 | It will post any delayed events whose time as "expired" onto the event queue. |
| 236 | It may also call SignalQueueTimer() and SignalNonEmptyQueue(). |
| 237 | */ |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 238 | static void ServiceQueueTimer(); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 239 | |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 240 | /** Return the number of queued events. note that this value may be obsolete |
| 241 | upon return, since another thread may have called ProcessEvent() or |
| 242 | Post() after the count was made. |
| 243 | */ |
| 244 | static int CountEventsOnQueue(); |
| 245 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 246 | //////////////////////////////////////////////////// |
| 247 | /** Porting layer must implement these functions **/ |
| 248 | //////////////////////////////////////////////////// |
| 249 | |
| 250 | /** Called whenever an SkEvent is posted to an empty queue, so that the OS |
| 251 | can be told to later call Dequeue(). |
| 252 | */ |
| 253 | static void SignalNonEmptyQueue(); |
| 254 | /** Called whenever the delay until the next delayed event changes. If zero is |
| 255 | passed, then there are no more queued delay events. |
| 256 | */ |
| 257 | static void SignalQueueTimer(SkMSec delay); |
| 258 | |
tfarina@chromium.org | 887760f | 2012-10-01 16:14:21 +0000 | [diff] [blame] | 259 | #if defined(SK_BUILD_FOR_WIN) |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 260 | static bool WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 261 | #endif |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 262 | |
| 263 | private: |
| 264 | SkMetaData fMeta; |
| 265 | mutable char* fType; // may be characters with low bit set to know that it is not a pointer |
| 266 | uint32_t f32; |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 267 | |
| 268 | // 'there can be only one' (non-zero) between target-id and target-proc |
reed@google.com | c514dde | 2011-08-03 19:41:24 +0000 | [diff] [blame] | 269 | SkEventSinkID fTargetID; |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 270 | Proc fTargetProc; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 271 | |
| 272 | // these are for our implementation of the event queue |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 273 | SkMSec fTime; |
| 274 | SkEvent* fNextEvent; // either in the delay or normal event queue |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 275 | |
| 276 | void initialize(const char* type, size_t typeLen, SkEventSinkID); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 277 | |
| 278 | static bool Enqueue(SkEvent* evt); |
| 279 | static SkMSec EnqueueTime(SkEvent* evt, SkMSec time); |
reed@google.com | 87fac4a | 2011-08-04 13:50:17 +0000 | [diff] [blame] | 280 | static SkEvent* Dequeue(); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 281 | static bool QHasEvents(); |
| 282 | }; |
| 283 | |
| 284 | #endif |