2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
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.
23 #include "livebox-cpp.h"
24 #include "livebox-impl.h"
28 #define EAPI __attribute__((visibility("default")))
30 EAPI int livebox_initialize(const char *pkgname)
34 module = CModule::FindModule(pkgname);
38 module = CModule::Load(pkgname);
45 EAPI int livebox_finalize(const char *pkgname)
49 module = CModule::FindModule(pkgname);
57 EAPI int livebox_create(const char *pkgname, const char *filename, const char *content, const char *cluster, const char *category)
63 module = CModule::FindModule(pkgname);
67 box = module->FindLiveBox(filename);
71 ret = module->Create(filename, content, cluster, category);
75 EAPI int livebox_destroy(const char *pkgname, const char *filename)
81 module = CModule::FindModule(pkgname);
85 box = module->FindLiveBox(filename);
89 ret = module->Destroy(box);
93 EAPI int livebox_need_to_update(const char *pkgname, const char *filename)
98 module = CModule::FindModule(pkgname);
102 box = module->FindLiveBox(filename);
106 return box->NeedToUpdate();
109 EAPI int livebox_need_to_destroy(const char *pkgname, const char *filename)
114 module = CModule::FindModule(pkgname);
118 box = module->FindLiveBox(filename);
122 return box->NeedToDestroy();
125 EAPI int livebox_update_content(const char *pkgname, const char *filename)
130 module = CModule::FindModule(pkgname);
134 box = module->FindLiveBox(filename);
138 return box->UpdateContent();
141 EAPI int livebox_clicked(const char *pkgname, const char *filename, const char *event, double timestamp, double x, double y)
146 module = CModule::FindModule(pkgname);
150 box = module->FindLiveBox(filename);
154 return box->Clicked(event, timestamp, x, y);
157 EAPI int livebox_content_event(const char *pkgname, const char *filename, const char *emission, const char *source, struct event_info *event_info)
162 module = CModule::FindModule(pkgname);
166 box = module->FindLiveBox(filename);
170 return box->ContentEvent(emission, source, event_info);
173 EAPI int livebox_resize(const char *pkgname, const char *filename, int type)
178 module = CModule::FindModule(pkgname);
182 box = module->FindLiveBox(filename);
186 return box->Resize(type);
189 EAPI int livebox_change_group(const char *pkgname, const char *filename, const char *cluster, const char *category)
194 module = CModule::FindModule(pkgname);
198 box = module->FindLiveBox(filename);
202 return box->ChangeGroup(cluster, category);
205 EAPI int livebox_get_info(const char *pkgname, const char *filename, int *w, int *h, double *priority, char **content, char **title)
210 module = CModule::FindModule(pkgname);
214 box = module->FindLiveBox(filename);
218 return box->GetInfo(w, h, priority, content, title);
221 EAPI int livebox_need_to_create(const char *pkgname, const char *cluster, const char *category)
225 module = CModule::FindModule(pkgname);
229 return module->NeedToCreate(cluster, category);
232 EAPI char *livebox_pinup(const char *pkgname, const char *filename, int pinup)
237 module = CModule::FindModule(pkgname);
241 box = module->FindLiveBox(filename);
245 return box->PinUp(pinup);
248 EAPI int livebox_is_pinned_up(const char *pkgname, const char *filename)
253 module = CModule::FindModule(pkgname);
257 box = module->FindLiveBox(filename);
261 return box->IsPinnedUp();
264 EAPI int livebox_system_event(const char *pkgname, const char *filename, int event)
269 module = CModule::FindModule(pkgname);
273 box = module->FindLiveBox(filename);
277 return box->SystemEvent(event);