libcss
Loading...
Searching...
No Matches
helpers.h
Go to the documentation of this file.
1/*
2 * This file is part of LibCSS
3 * Licensed under the MIT License,
4 * http://www.opensource.org/licenses/mit-license.php
5 * Copyright 2009 John-Mark Bell <jmb@netsurf-browser.org>
6 */
7
8#ifndef css_select_helpers_h_
9#define css_select_helpers_h_
10
14static inline css_unit css__to_css_unit(uint32_t u)
15{
16 switch (u) {
17 case UNIT_PX: return CSS_UNIT_PX;
18 case UNIT_EX: return CSS_UNIT_EX;
19 case UNIT_EM: return CSS_UNIT_EM;
20 case UNIT_IN: return CSS_UNIT_IN;
21 case UNIT_CM: return CSS_UNIT_CM;
22 case UNIT_MM: return CSS_UNIT_MM;
23 case UNIT_PT: return CSS_UNIT_PT;
24 case UNIT_PC: return CSS_UNIT_PC;
25 case UNIT_CH: return CSS_UNIT_CH;
26 case UNIT_REM: return CSS_UNIT_REM;
27 case UNIT_LH: return CSS_UNIT_LH;
28 case UNIT_VH: return CSS_UNIT_VH;
29 case UNIT_VW: return CSS_UNIT_VW;
30 case UNIT_VI: return CSS_UNIT_VI;
31 case UNIT_VB: return CSS_UNIT_VB;
32 case UNIT_VMIN: return CSS_UNIT_VMIN;
33 case UNIT_VMAX: return CSS_UNIT_VMAX;
34 case UNIT_Q: return CSS_UNIT_Q;
35 case UNIT_PCT: return CSS_UNIT_PCT;
36 case UNIT_DEG: return CSS_UNIT_DEG;
37 case UNIT_GRAD: return CSS_UNIT_GRAD;
38 case UNIT_RAD: return CSS_UNIT_RAD;
39 case UNIT_MS: return CSS_UNIT_MS;
40 case UNIT_S: return CSS_UNIT_S;
41 case UNIT_HZ: return CSS_UNIT_HZ;
42 case UNIT_KHZ: return CSS_UNIT_KHZ;
43 }
44
45 return 0;
46}
47
48#endif
@ UNIT_VW
Definition bytecode.h:63
@ UNIT_CH
Definition bytecode.h:59
@ UNIT_GRAD
Definition bytecode.h:74
@ UNIT_PCT
Definition bytecode.h:70
@ UNIT_PT
Definition bytecode.h:57
@ UNIT_Q
Definition bytecode.h:68
@ UNIT_VB
Definition bytecode.h:65
@ UNIT_KHZ
Definition bytecode.h:84
@ UNIT_VMIN
Definition bytecode.h:66
@ UNIT_S
Definition bytecode.h:80
@ UNIT_CM
Definition bytecode.h:55
@ UNIT_REM
Definition bytecode.h:60
@ UNIT_IN
Definition bytecode.h:54
@ UNIT_EX
Definition bytecode.h:52
@ UNIT_MM
Definition bytecode.h:56
@ UNIT_HZ
Definition bytecode.h:83
@ UNIT_VMAX
Definition bytecode.h:67
@ UNIT_DEG
Definition bytecode.h:73
@ UNIT_PC
Definition bytecode.h:58
@ UNIT_EM
Definition bytecode.h:53
@ UNIT_PX
Definition bytecode.h:51
@ UNIT_VI
Definition bytecode.h:64
@ UNIT_RAD
Definition bytecode.h:75
@ UNIT_LH
Definition bytecode.h:61
@ UNIT_VH
Definition bytecode.h:62
@ UNIT_MS
Definition bytecode.h:79
css_unit
Definition types.h:82
@ CSS_UNIT_HZ
Definition types.h:111
@ CSS_UNIT_PX
Definition types.h:83
@ CSS_UNIT_LH
Definition types.h:93
@ CSS_UNIT_VMIN
Definition types.h:98
@ CSS_UNIT_Q
Definition types.h:100
@ CSS_UNIT_VMAX
Definition types.h:99
@ CSS_UNIT_MM
Definition types.h:88
@ CSS_UNIT_EM
Definition types.h:85
@ CSS_UNIT_PCT
Definition types.h:102
@ CSS_UNIT_VI
Definition types.h:96
@ CSS_UNIT_MS
Definition types.h:108
@ CSS_UNIT_KHZ
Definition types.h:112
@ CSS_UNIT_CM
Definition types.h:87
@ CSS_UNIT_IN
Definition types.h:86
@ CSS_UNIT_REM
Definition types.h:92
@ CSS_UNIT_RAD
Definition types.h:106
@ CSS_UNIT_EX
Definition types.h:84
@ CSS_UNIT_PT
Definition types.h:89
@ CSS_UNIT_PC
Definition types.h:90
@ CSS_UNIT_GRAD
Definition types.h:105
@ CSS_UNIT_CH
Definition types.h:91
@ CSS_UNIT_DEG
Definition types.h:104
@ CSS_UNIT_S
Definition types.h:109
@ CSS_UNIT_VW
Definition types.h:95
@ CSS_UNIT_VH
Definition types.h:94
@ CSS_UNIT_VB
Definition types.h:97