OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004 Apple Computer, Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 18 matching lines...) Expand all Loading... |
29 #ifdef __OBJC__ | 29 #ifdef __OBJC__ |
30 #include <AppKit/NSTextView.h> | 30 #include <AppKit/NSTextView.h> |
31 #endif | 31 #endif |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 // These match the AppKit values for these concepts. | 35 // These match the AppKit values for these concepts. |
36 // From NSTextView.h: | 36 // From NSTextView.h: |
37 // NSSelectionAffinityUpstream = 0 | 37 // NSSelectionAffinityUpstream = 0 |
38 // NSSelectionAffinityDownstream = 1 | 38 // NSSelectionAffinityDownstream = 1 |
39 enum EAffinity { UPSTREAM = 0, DOWNSTREAM = 1 }; | 39 // TODO(yosin) We should rename |UPSTREAM| and |DOWNSTREAM| to use |
| 40 // capitalized name. |
| 41 enum EAffinity { UPSTREAM = 0, DOWNSTREAM = 1 }; // NOLINT |
40 | 42 |
41 } // namespace blink | 43 } // namespace blink |
42 | 44 |
43 #ifdef __OBJC__ | 45 #ifdef __OBJC__ |
44 | 46 |
45 inline NSSelectionAffinity kit(blink::EAffinity affinity) | 47 inline NSSelectionAffinity kit(blink::EAffinity affinity) |
46 { | 48 { |
47 return static_cast<NSSelectionAffinity>(affinity); | 49 return static_cast<NSSelectionAffinity>(affinity); |
48 } | 50 } |
49 | 51 |
50 inline blink::EAffinity core(NSSelectionAffinity affinity) | 52 inline blink::EAffinity core(NSSelectionAffinity affinity) |
51 { | 53 { |
52 return static_cast<blink::EAffinity>(affinity); | 54 return static_cast<blink::EAffinity>(affinity); |
53 } | 55 } |
54 | 56 |
55 #endif | 57 #endif |
56 | 58 |
57 #endif // TextAffinity_h | 59 #endif // TextAffinity_h |
OLD | NEW |