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.
19 #include <Elementary.h>
28 #include <InputHandler.h>
30 #include "FbBaseView.h"
31 #include <ExtNameInfo.h>
32 #include "FbContextView.h"
36 #define PARAM_SOURCE "source"
37 #define FBR_WIN_TITLE "File Browser"
39 Evas_Object *_add_win(const char *name)
43 //win = elm_win_add(NULL, name, ELM_WIN_BASIC);
44 win = elm_win_util_standard_add(name, NULL);
48 elm_win_title_set(win, FBR_WIN_TITLE);
49 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
50 elm_win_focus_highlight_style_set(win, FBR_STYLE_WIN_FOCUS);
51 elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_CLICK);
52 evas_object_show(win);
57 class CApp : public CBaseApp {
65 CFbBaseView *pFbBaseView;
66 CContextView *pContextView;
69 virtual bool OnCreate(void)
73 elm_theme_overlay_add(NULL, THEMEFILE);
75 win = _add_win(ad.name);
84 virtual void OnTerminate(void)
89 evas_object_del(ad.win);
94 virtual void OnService(service_h service)
98 CViewMgr* viewmgr = NULL;
100 _DBG(" ******************* OnService *********************");
101 elm_win_activate(ad.win);
103 r = service_get_extra_data(service, PARAM_SOURCE, &source);
104 if (r != SERVICE_ERROR_NONE)
108 ad.source = strdup(source);
113 ad.source = strdup("all");
116 CSortMgr::Initialize();
118 CViewMgr::Initialize(ad.win,NULL);
119 viewmgr = CViewMgr::GetInstance();
121 _ERR("Fail to get viewmgr instance");
125 pFbBaseView = new CFbBaseView(FBR_BASE_VIEW);
126 if(!viewmgr->AddView(pFbBaseView))
128 _ERR("Fail to add pFbBaseView");
132 pContextView = new CContextView(FBR_CONTEXT_VIEW);
133 if(!viewmgr->AddView(pContextView))
135 _ERR("Fail to add pContextView");
139 if (!viewmgr->PushView(FBR_BASE_VIEW, ad.source)) {
140 _ERR("Fail to push view");
146 CViewMgr::Finalize();
152 virtual int Run(int argc, char **argv) {
153 memset(&ad, 0x00, sizeof(_appdata));
156 return CBaseApp::Run(argc, argv);
160 int main(int argc, char **argv)