OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SK_FLAGS_H | 8 #ifndef SK_FLAGS_H |
9 #define SK_FLAGS_H | 9 #define SK_FLAGS_H |
10 | 10 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 *fDoubleValue = value; | 291 *fDoubleValue = value; |
292 } else { | 292 } else { |
293 SkASSERT(!"Can only call setDouble on kDouble_FlagType"); | 293 SkASSERT(!"Can only call setDouble on kDouble_FlagType"); |
294 } | 294 } |
295 } | 295 } |
296 | 296 |
297 SkFlagInfo* next() { return fNext; } | 297 SkFlagInfo* next() { return fNext; } |
298 | 298 |
299 const SkString& name() const { return fName; } | 299 const SkString& name() const { return fName; } |
300 | 300 |
| 301 const SkString& shortName() const { return fShortName; } |
| 302 |
301 const SkString& help() const { return fHelpString; } | 303 const SkString& help() const { return fHelpString; } |
302 | 304 |
303 SkString defaultValue() const { | 305 SkString defaultValue() const { |
304 SkString result; | 306 SkString result; |
305 switch (fFlagType) { | 307 switch (fFlagType) { |
306 case SkFlagInfo::kBool_FlagType: | 308 case SkFlagInfo::kBool_FlagType: |
307 result.printf("%s", fDefaultBool ? "true" : "false"); | 309 result.printf("%s", fDefaultBool ? "true" : "false"); |
308 break; | 310 break; |
309 case SkFlagInfo::kString_FlagType: | 311 case SkFlagInfo::kString_FlagType: |
310 return fDefaultString; | 312 return fDefaultString; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 double* fDoubleValue; | 365 double* fDoubleValue; |
364 double fDefaultDouble; | 366 double fDefaultDouble; |
365 SkTDArray<const char*>* fStrings; | 367 SkTDArray<const char*>* fStrings; |
366 // Both for the help string and in case fStrings is empty. | 368 // Both for the help string and in case fStrings is empty. |
367 SkString fDefaultString; | 369 SkString fDefaultString; |
368 | 370 |
369 // In order to keep a linked list. | 371 // In order to keep a linked list. |
370 SkFlagInfo* fNext; | 372 SkFlagInfo* fNext; |
371 }; | 373 }; |
372 #endif // SK_FLAGS_H | 374 #endif // SK_FLAGS_H |
OLD | NEW |