#include "config.h"
#include "EvBrowserPlugin.h"
#include "EvBrowserPluginToolbar.h"
#include "npfunctions.h"
#include <errno.h>
#include <gtk/gtkx.h>
#include <limits>
#include <string.h>
Go to the source code of this file.
|
template<typename IntegerType > |
static void | parseInteger (const char *strValue, IntegerType &intValue) |
|
static void | parseDouble (const char *strValue, double &doubleValue) |
|
static void | parseBoolean (const char *strValue, bool &boolValue) |
|
static void | parseZoomMode (const char *strValue, EvSizingMode &sizingModeValue) |
|
static void parseBoolean |
( |
const char * |
strValue, |
|
|
bool & |
boolValue |
|
) |
| |
|
inlinestatic |
Definition at line 135 of file EvBrowserPlugin.cpp.
141 if (g_ascii_strcasecmp(value.get(),
"false") == 0 || g_ascii_strcasecmp(value.get(),
"no") == 0)
143 else if (g_ascii_strcasecmp(value.get(),
"true") == 0 || g_ascii_strcasecmp(value.get(),
"yes") == 0)
146 int intValue = boolValue;
147 parseInteger<int>(strValue, intValue);
148 boolValue = intValue > 0;
static void parseDouble |
( |
const char * |
strValue, |
|
|
double & |
doubleValue |
|
) |
| |
|
inlinestatic |
Definition at line 123 of file EvBrowserPlugin.cpp.
128 char *endPtr =
nullptr;
130 double value = g_ascii_strtod(strValue, &endPtr);
131 if (endPtr != strValue && errno == 0)
template<typename IntegerType >
static void parseInteger |
( |
const char * |
strValue, |
|
|
IntegerType & |
intValue |
|
) |
| |
|
inlinestatic |
Definition at line 108 of file EvBrowserPlugin.cpp.
110 static const IntegerType intMax = std::numeric_limits<IntegerType>::max();
111 static const bool isSigned = std::numeric_limits<IntegerType>::is_signed;
116 char *endPtr =
nullptr;
118 gint64 value = isSigned ? g_ascii_strtoll(strValue, &endPtr, 0) : g_ascii_strtoull(strValue, &endPtr, 0);
119 if (endPtr != strValue && errno == 0 && value <= intMax)
120 intValue =
static_cast<IntegerType
>(value);
static void parseZoomMode |
( |
const char * |
strValue, |
|
|
EvSizingMode & |
sizingModeValue |
|
) |
| |
|
inlinestatic |
Definition at line 152 of file EvBrowserPlugin.cpp.
158 if (g_ascii_strcasecmp(value.get(),
"none") == 0)
160 else if (g_ascii_strcasecmp(value.get(),
"fit-page") == 0)
162 else if (g_ascii_strcasecmp(value.get(),
"fit-width") == 0)
164 else if (g_ascii_strcasecmp(value.get(),
"auto") == 0)