4 * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
8 * Lyupa Anastasia <a.lyupa@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
23 * - Samsung RnD Institute Russia
27 #ifndef _UI_VIEWER_UTILS_
28 #define _UI_VIEWER_UTILS_
34 #include "app_protocol.h" /* from swap-probe-devel package */
36 #include "ui_viewer_data.h"
38 #define DA_LOG_MAX 4096
39 #define TMP_DIR "/run/swap/tmp/da"
41 #define __unused __attribute__((unused))
47 char data[DA_LOG_MAX];
50 // ========================= print log =====================================
51 #define PRINTMSG(...) print_log_fmt(APP_MSG_MSG, __FUNCTION__, __LINE__, __VA_ARGS__)
52 #define PRINTWRN(...) print_log_fmt(APP_MSG_WARNING, __FUNCTION__, __LINE__, __VA_ARGS__)
53 #define PRINTERR(...) print_log_fmt(APP_MSG_ERROR, __FUNCTION__, __LINE__, __VA_ARGS__)
58 info.msg_total_size = 0; \
59 info.msg_pack_size = 0; \
61 info.msg_buf = (char *)""
66 struct sockaddr *sock;
68 uint64_t msg_total_size;
69 uint32_t msg_pack_size;
77 char * _strncpy(char *dest, const char *src, size_t n);
78 bool print_log_fmt(int msgType, const char *func_name, int line, ...);
79 bool print_log_str(int msgType, char *st);
80 bool print_log_ui_viewer_hierarchy_status(enum ErrorCode *err_code);
81 void print_log_ui_viewer_info_list(Eina_Bool rendering);
82 bool print_log_ui_viewer_hierarchy_error(void);
83 bool print_log_ui_obj_screenshot(Evas_Object *obj);
84 bool printLog(log_t* log, int msgType);
85 void raise_app_window(void);
87 int ui_viewer_capture_screen(char *screenshot_path, Evas_Object *obj);
89 void ui_viewer_clean_log(void);
90 void ui_viewer_log(const char *format, ...);
92 #endif /* _UI_VIEWER_UTILS_ */