Release version 1.8.3
[platform/core/appfw/app-core.git] / src / multiwindow_base / appcore_multiwindow_base_private.h
1 /*
2  * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #pragma once
18
19 #define LOG_TAG "APP_CORE_MULTIWINDOW_BASE"
20
21 #include <stdio.h>
22 #include <stdbool.h>
23 #include <dlog.h>
24 #include <glib.h>
25
26 #include "appcore_base.h"
27 #include "appcore_multiwindow_base.h"
28
29 #ifndef EXPORT_API
30 #  define EXPORT_API __attribute__ ((visibility("default")))
31 #endif
32
33 #ifndef _DLOG_H_
34 #  define _ERR(fmt, arg...) \
35         do { fprintf(stderr, "appcore: "fmt"\n", ##arg); } while (0)
36
37 #  define _INFO(fmt, arg...) \
38         do { fprintf(stdout, fmt"\n", ##arg); } while (0)
39
40 #  define _DBG(fmt, arg...) \
41         do { \
42                 if (getenv("APPCORE_DEBUG")) { \
43                         fprintf(stdout, fmt"\n", ##arg); \
44                 } \
45         } while (0)
46 #else
47 #  define _ERR(fmt, arg...) \
48         do { \
49                 fprintf(stderr, "appcore: "fmt"\n", ##arg); \
50                 LOGE(fmt, ##arg); \
51         } while (0)
52 #  define _INFO(...) LOGI(__VA_ARGS__)
53 #  define _DBG(...) LOGD(__VA_ARGS__)
54 #endif
55
56 typedef struct _appcore_multiwindow_base_context {
57         appcore_multiwindow_base_ops ops;
58         void *data;
59         int argc;
60         char **argv;
61         GList *classes;
62         GList *instances;
63
64         Ecore_Event_Handler *hshow;
65         Ecore_Event_Handler *hhide;
66         Ecore_Event_Handler *hvchange;
67         Ecore_Event_Handler *hlower;
68 } appcore_multiwindow_base_context;
69
70 typedef struct _appcore_multiwindow_base_instance {
71         unsigned int window_id;
72         char *id;
73         void *extra;
74         appcore_multiwindow_base_class *shell;
75         bool is_resumed;
76 } appcore_multiwindow_base_instance;
77