static void exec_app(rtgui_widget_t* widget, void* parameter) { char path[64]; rt_module_t module; RT_ASSERT(parameter != RT_NULL); rt_snprintf(path, sizeof(path), "%s/%s/%s.mo", APP_PATH, (char*)parameter, (char*)parameter); #ifndef _WIN32 module = rt_module_find((const char*)parameter); if(module == RT_NULL) rt_module_open(path); else { struct rtgui_app* app; RT_ASSERT(module->module_thread); app = (struct rtgui_app*)(module->module_thread->user_data); if(app != RT_NULL) rtgui_app_activate(app); else rt_kprintf("application is null\n"); } #endif }
static void exec_internal_app(struct app_item *item) { struct rtgui_app *app; if (!item) return; if (item->app_starter == RT_NULL) { rt_kprintf("can not start the app,app_starter is NULL!\n"); return; } statusbar_set_title(item->text); if (item->name != RT_NULL) { app = rtgui_app_find(item->name); if (app == RT_NULL) { item->app_starter(item->parameter); } else { rtgui_app_activate(app); statusbar_show_back_button(RT_TRUE); } statusbar_show_back_button(RT_TRUE); } else { item->app_starter(item->parameter); } }
static rt_bool_t _handle_app_activate(struct rtgui_object* object, struct rtgui_event* event) { struct rtgui_application_item *item; if (app_list->current_item == -1) return RT_TRUE; item = &app_items[app_list->current_item]; rtgui_app_activate(item->app); return RT_TRUE; }