#include "config.h"
#include "EditorState.h"
#include "Arguments.h"
#include "WebCoreArgumentCoders.h"
namespace WebKit {
void EditorState::encode(CoreIPC::ArgumentEncoder& encoder) const
{
encoder << shouldIgnoreCompositionSelectionChange;
encoder << selectionIsNone;
encoder << selectionIsRange;
encoder << isContentEditable;
encoder << isContentRichlyEditable;
encoder << isInPasswordField;
encoder << isInPlugin;
encoder << hasComposition;
#if PLATFORM(QT)
encoder << cursorPosition;
encoder << anchorPosition;
encoder << editorRect;
encoder << compositionRect;
encoder << inputMethodHints;
encoder << selectedText;
encoder << surroundingText;
#endif
#if PLATFORM(QT) || PLATFORM(GTK)
encoder << cursorRect;
#endif
}
bool EditorState::decode(CoreIPC::ArgumentDecoder& decoder, EditorState& result)
{
if (!decoder.decode(result.shouldIgnoreCompositionSelectionChange))
return false;
if (!decoder.decode(result.selectionIsNone))
return false;
if (!decoder.decode(result.selectionIsRange))
return false;
if (!decoder.decode(result.isContentEditable))
return false;
if (!decoder.decode(result.isContentRichlyEditable))
return false;
if (!decoder.decode(result.isInPasswordField))
return false;
if (!decoder.decode(result.isInPlugin))
return false;
if (!decoder.decode(result.hasComposition))
return false;
#if PLATFORM(QT)
if (!decoder.decode(result.cursorPosition))
return false;
if (!decoder.decode(result.anchorPosition))
return false;
if (!decoder.decode(result.editorRect))
return false;
if (!decoder.decode(result.compositionRect))
return false;
if (!decoder.decode(result.inputMethodHints))
return false;
if (!decoder.decode(result.selectedText))
return false;
if (!decoder.decode(result.surroundingText))
return false;
#endif
#if PLATFORM(QT) || PLATFORM(GTK)
if (!decoder.decode(result.cursorRect))
return false;
#endif
return true;
}
}