예제 #1
0
void
theme_set(const char *edje_file)
{
   if (!edje_file) return;

   th = elm_theme_new();
   elm_theme_ref_set(th, NULL);
   elm_theme_overlay_add(th, edje_file);
}
예제 #2
0
/**
 * @brief __br_app_create 应用程序初始化
 * @param app_data 应用程序数据
 * @return 是否执行成功
 */
static bool __br_app_create(void *app_data)
{
    BROWSER_LOGD("********************[Browser-Launching time measure] << theme extenstion >>");
	struct browser_data *ad = (struct browser_data *)app_data;

	elm_config_preferred_engine_set("opengl_x11");


	/**
	 *加载配置文件
	 */
	if(!__init_preference())
		return false;
	/**
	*加载主题
	*/
	ad->browser_theme = elm_theme_new();
	elm_theme_ref_set(ad->browser_theme, NULL);
	elm_theme_extension_add(ad->browser_theme, BROWSER_NAVIFRAME_THEME);
	elm_theme_extension_add(ad->browser_theme, BROWSER_CONTROLBAR_THEME);
	elm_theme_extension_add(ad->browser_theme, BROWSER_BUTTON_THEME);
	elm_theme_extension_add(ad->browser_theme, BROWSER_PROGRESSBAR_THEME);
	elm_theme_extension_add(ad->browser_theme, BROWSER_URL_LAYOUT_THEME);
	elm_theme_extension_add(ad->browser_theme, BROWSER_PREDICTIVE_HISTORY_THEME);
	elm_theme_extension_add(ad->browser_theme, BROWSER_SETTINGS_THEME);
	elm_theme_extension_add(ad->browser_theme, BROWSER_BOOKMARK_THEME);
	elm_theme_extension_add(ad->browser_theme, BROWSER_FIND_WORD_LAYOUT_THEME);

	BROWSER_LOGD("[Browser-Launching time measure] << create main window >>");
	ad->main_win = __create_main_win(ad); //创建窗口
	if (!ad->main_win) {
		BROWSER_LOGE("fail to create window");
		return false;
	}

	BROWSER_LOGD("[Browser-Launching time measure] << create background >>");
    ad->bg = __create_bg(ad->main_win); //
	if (!ad->bg) {
		BROWSER_LOGE("fail to create bg");
		return false;
	}

	BROWSER_LOGD("[Browser-Launching time measure] << create layout main >>");
	ad->main_layout = __create_main_layout(ad->main_win);
	if (!ad->main_layout) {
		BROWSER_LOGE("fail to create main layout");
		return false;
	}

	ad->navi_bar = __create_navi_bar(ad);
	if (!ad->navi_bar) {
		BROWSER_LOGE("fail to create navi bar");
		return false;
	}

	/* create browser instance & init */
	ad->browser_instance = new(nothrow) Browser_Class(ad->main_win, ad->navi_bar, ad->bg);
	if (!ad->browser_instance) {
		BROWSER_LOGE("fail to Browser_Class");
		return false;
    }
    /**
      *初始化browser_view
      */
	if (ad->browser_instance->init() == EINA_FALSE) {
		BROWSER_LOGE("fail to browser init");
		return false;
	}

	/* init internationalization */
	int ret = __browser_set_i18n(BROWSER_PACKAGE_NAME, BROWSER_LOCALE_DIR);
	if (ret) {
		BROWSER_LOGE("fail to __browser_set_i18n");
		return false;
	}

#if defined(HORIZONTAL_UI)
	app_device_orientation_e rotation_value = app_get_device_orientation();

	if (rotation_value != APP_DEVICE_ORIENTATION_0) {
		elm_win_rotation_with_resize_set(ad->main_win, rotation_value);
		ad->browser_instance->rotate(rotation_value);
	}
#endif

	return true;
}