2 * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "magnifier_configure_bin_parser.h"
19 #include "file_storage.h"
22 #include "put_record.h"
24 BinMagnifierConfigParser::BinMagnifierConfigParser() {
25 memset((void*)&m_magnifier_configure, 0x00, sizeof(SclMagnifierWndConfigure));
26 parser_info_provider = NULL;
29 BinMagnifierConfigParser::~BinMagnifierConfigParser() {
32 BinMagnifierConfigParser* BinMagnifierConfigParser::get_instance() {
33 static BinMagnifierConfigParser instance;
37 void BinMagnifierConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
38 m_storage.set_str_provider(provider);
39 m_storage.get_storage(storage, offset, size);
40 this->parser_info_provider = provider;
41 parsing_magnifier_configure();
45 void BinMagnifierConfigParser::parsing_magnifier_configure() {
46 Magnifier_configure_width record_width;
47 set_magnifier_configure_width(*parser_info_provider, record_width);
49 PSclMagnifierWndConfigure cur = &m_magnifier_configure;
55 cur->style = (SCLMagnifierStyle)m_storage.get<sint_t>(record_width.style);
57 cur->width = m_storage.get<sint_t>(record_width.width);
59 cur->height = m_storage.get<sint_t>(record_width.height);
60 //label_area_record.left
61 cur->label_area_rect.left = m_storage.get<sint_t>(record_width.label_area_rect);
62 //label_area_rect.right
63 cur->label_area_rect.right = m_storage.get<sint_t>(record_width.label_area_rect);
65 //label_area_record.top
66 cur->label_area_rect.top = m_storage.get<sint_t>(record_width.label_area_rect);
67 //label_area_rect.bottom
68 cur->label_area_rect.bottom = m_storage.get<sint_t>(record_width.label_area_rect);
70 m_storage.get_str(&(cur->bg_image_path), record_width.bg_image_path, m_string_collector);
73 m_storage.get_str(&(cur->bg_shift_image_path), record_width.bg_shift_image_path, m_string_collector);
75 //bg_shift_lock_image_path
76 m_storage.get_str(&(cur->bg_shift_lock_image_path), record_width.bg_shift_lock_image_path, m_string_collector);
78 //bg_long_key_image_path
79 m_storage.get_str(&(cur->bg_long_key_image_path), record_width.bg_long_key_image_path, m_string_collector);
81 cur->use_actual_window = m_storage.get<sint_t>(record_width.use_actual_window);
83 m_storage.get_str(&(cur->label_type), record_width.label_type, m_string_collector);
85 cur->padding_x = m_storage.get<sint_t>(record_width.padding_x);
87 cur->padding_y = m_storage.get<sint_t>(record_width.padding_y);
89 cur->show_shift_label = m_storage.get<sint_t>(record_width.show_shift_label);
91 #ifdef __SCL_TXT_DEBUG
92 put_magnifier_wnd_configure(DECODE, m_magnifier_configure);
96 PSclMagnifierWndConfigure BinMagnifierConfigParser::get_magnifier_configure() {
97 return &m_magnifier_configure;