add support for Ayatana indicator to Notification plugin
[claws.git] / src / plugins / litehtml_viewer / litehtml / html.h
blob818d5ce56546e4912b908d9123c086be1ee41d94
1 #ifndef LH_HTML_H
2 #define LH_HTML_H
4 #include <stdlib.h>
5 #include <string>
6 #include <ctype.h>
7 #include <vector>
8 #include <map>
9 #include <cstring>
10 #include <algorithm>
11 #include <functional>
12 #include "os_types.h"
13 #include "string_id.h"
14 #include "types.h"
15 #include "utf8_strings.h"
16 #include "background.h"
17 #include "borders.h"
18 #include "web_color.h"
19 #include "media_query.h"
20 #include "html_tag.h"
21 #include "document_container.h"
22 #include "document.h"
24 namespace litehtml
26 void trim(string &s, const string& chars_to_trim = " \n\r\t");
27 void lcase(string &s);
28 int value_index(const string& val, const string& strings, int defValue = -1, char delim = ';');
29 string index_value(int index, const string& strings, char delim = ';');
30 bool value_in_list(const string& val, const string& strings, char delim = ';');
31 string::size_type find_close_bracket(const string &s, string::size_type off, char open_b = '(', char close_b = ')');
32 void split_string(const string& str, string_vector& tokens, const string& delims, const string& delims_preserve = "", const string& quote = "\"");
33 void join_string(string& str, const string_vector& tokens, const string& delims);
34 double t_strtod(const char* string, char** endPtr = nullptr);
35 string get_escaped_string(const string& in_str);
37 int t_strcasecmp(const char *s1, const char *s2);
38 int t_strncasecmp(const char *s1, const char *s2, size_t n);
40 bool is_number(const string& string, const bool allow_dot = 1);
42 inline int t_isdigit(int c)
44 return (c >= '0' && c <= '9');
47 inline int t_isalpha(int c)
49 return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
52 inline int t_tolower(int c)
54 return (c >= 'A' && c <= 'Z' ? c + 'a' - 'A' : c);
57 inline int round_f(float val)
59 int int_val = (int) val;
60 if(val - int_val >= 0.5)
62 int_val++;
64 return int_val;
67 inline int round_d(double val)
69 int int_val = (int) val;
70 if(val - int_val >= 0.5)
72 int_val++;
74 return int_val;
77 inline float t_strtof(const string& str, char** endPtr = nullptr)
79 return (float)t_strtod(str.c_str(), endPtr);
82 inline int baseline_align(int line_height, int line_base_line, int height, int baseline)
84 return (line_height - line_base_line) - (height - baseline);
88 #endif // LH_HTML_H