Go to the source code of this file.
Functions | |
G_BEGIN_DECLS BrowserWindow * | view_create (void) |
void | view_destroy (void) |
void | view_zoom_in (void) |
void | view_zoom_out (void) |
void | view_set_zoom_level (gfloat zoom_level) |
void | view_full_screen (gboolean mode) |
void | view_go_back (void) |
void | view_go_forward (void) |
void | view_reload (void) |
void | view_open_uri (const char *uri) |
void | view_set_statusbar (gchar *message) |
void | view_show_busy (gboolean show) |
void | view_show_error (const gchar *title, const gchar *message) |
void | view_open_emall (void) |
void | view_set_text (void) |
void | view_deactivated (void) |
void | view_open_last (void) |
gboolean | view_is_page_loaded (void) |
G_BEGIN_DECLS BrowserWindow* view_create | ( | void | ) |
Description: Webview Copyright (C) 2009 iRex Technologies B.V. All rights reserved.
Definition at line 182 of file view.c.
References create_show_busy_loading(), create_window(), g_browser, g_ebook_mall_home, get_ebook_mall_home(), LOGPRINTF, and meta_initialize().
Referenced by main().
00183 { 00184 LOGPRINTF("entry"); 00185 00186 meta_initialize(); 00187 00188 g_browser = create_window(); 00189 create_show_busy_loading(); 00190 g_ebook_mall_home = get_ebook_mall_home(); 00191 00192 return g_browser; 00193 }
void view_deactivated | ( | void | ) |
Definition at line 418 of file view.c.
References g_browser, LOGPRINTF, and main_quit().
Referenced by on_window_deactivated().
00419 { 00420 LOGPRINTF("entry"); 00421 if (!g_browser) 00422 { 00423 return; 00424 } 00425 00426 main_quit(); 00427 }
void view_destroy | ( | void | ) |
Definition at line 196 of file view.c.
References g_browser, g_ebook_mall_home, and LOGPRINTF.
Referenced by main_quit().
00197 { 00198 LOGPRINTF("entry"); 00199 00200 if (g_browser) 00201 { 00202 gchar * application = g_object_get_data(G_OBJECT(g_browser->back_listview), "application"); 00203 if (application) 00204 { 00205 g_free(application); 00206 } 00207 00208 if (g_browser->window) 00209 { 00210 LOGPRINTF("destroy window"); 00211 gtk_widget_destroy(g_browser->window); 00212 g_browser->window = NULL; 00213 } 00214 } 00215 00216 LOGPRINTF("clearing cache"); 00217 system("rm -rf /var/cache/webkit"); 00218 00219 g_free(g_ebook_mall_home); 00220 }
void view_full_screen | ( | gboolean | mode | ) |
Definition at line 297 of file view.c.
References g_browser, g_main_window, LOGPRINTF, menu_set_full_screen(), and meta_set_full_screen().
Referenced by main(), menu_on_item_activated(), and view_open_uri().
00298 { 00299 LOGPRINTF("entry: %d", mode); 00300 00301 g_object_set(G_OBJECT(webkit_web_view_get_window_features(WEBKIT_WEB_VIEW(g_browser->web_view))), 00302 "fullscreen", mode, 00303 NULL); 00304 if (mode) 00305 { 00306 gtk_window_fullscreen(GTK_WINDOW(g_main_window)); 00307 } 00308 else 00309 { 00310 gtk_window_unfullscreen(GTK_WINDOW(g_main_window)); 00311 } 00312 00313 menu_set_full_screen(mode); 00314 meta_set_full_screen(mode); 00315 }
void view_go_back | ( | void | ) |
Definition at line 318 of file view.c.
References g_browser, go_back_cb(), and LOGPRINTF.
Referenced by menu_on_item_activated().
00319 { 00320 LOGPRINTF("entry"); 00321 go_back_cb(NULL, g_browser); 00322 }
void view_go_forward | ( | void | ) |
Definition at line 325 of file view.c.
References g_browser, go_forward_cb(), and LOGPRINTF.
Referenced by menu_on_item_activated().
00326 { 00327 LOGPRINTF("entry"); 00328 go_forward_cb(NULL, g_browser); 00329 }
gboolean view_is_page_loaded | ( | void | ) |
Definition at line 430 of file view.c.
References g_page_loaded.
Referenced by on_disconnect().
00431 { 00432 return g_page_loaded; 00433 }
void view_open_emall | ( | void | ) |
Definition at line 436 of file view.c.
References g_ebook_mall_home, and view_open_uri().
Referenced by go_emall_cb(), and main().
00437 { 00438 view_open_uri(g_ebook_mall_home); 00439 }
void view_open_last | ( | void | ) |
void view_open_uri | ( | const char * | uri | ) |
Definition at line 360 of file view.c.
References g_browser, is_local_file(), load_error_page(), LOGPRINTF, magic_uri(), meta_file_open(), meta_get_full_screen(), meta_get_zoom_level(), set_browser_uri(), view_full_screen(), and view_set_zoom_level().
Referenced by activate_uri_entry_cb(), main(), on_file_open(), and view_open_emall().
00361 { 00362 LOGPRINTF("entry: %s", uri); 00363 00364 gchar *full_uri; 00365 full_uri = magic_uri(uri); 00366 00367 gboolean is_file = is_local_file(full_uri); 00368 if (is_file) 00369 { 00370 gchar *file_path = full_uri+strlen("file://"); 00371 if (!g_file_test(file_path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) 00372 { 00373 load_error_page(full_uri, NULL); 00374 goto err; 00375 } 00376 00377 // read application meta data 00378 meta_file_open(file_path); 00379 } 00380 00381 set_browser_uri(full_uri); 00382 webkit_web_view_open(WEBKIT_WEB_VIEW(g_browser->web_view), full_uri); 00383 00384 if (is_file) 00385 { 00386 // apply application meta data 00387 view_set_zoom_level(meta_get_zoom_level()); 00388 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW 00389 view_full_screen (meta_get_full_screen()); 00390 #endif 00391 } 00392 00393 err: 00394 g_free(full_uri); 00395 }
void view_reload | ( | void | ) |
Definition at line 332 of file view.c.
References g_browser, LOGPRINTF, and reload_cb().
Referenced by menu_on_item_activated().
void view_set_statusbar | ( | gchar * | message | ) |
void view_set_text | ( | void | ) |
Definition at line 405 of file view.c.
References g_browser, LOGPRINTF, and update_back_liststore().
Referenced by main(), and on_locale().
00406 { 00407 LOGPRINTF("entry"); 00408 if (!g_browser || !g_browser->back_liststore) 00409 { 00410 return; 00411 } 00412 00413 gtk_list_store_clear(g_browser->back_liststore); 00414 update_back_liststore(g_browser->back_listview, g_browser->back_liststore); 00415 }
void view_set_zoom_level | ( | gfloat | zoom_level | ) |
Definition at line 285 of file view.c.
References g_browser, LOGPRINTF, menu_set_zoom_level(), meta_set_zoom_level(), and show_busy().
Referenced by menu_on_item_activated(), and view_open_uri().
00286 { 00287 LOGPRINTF("entry: %f", zoom_level); 00288 00289 show_busy(TRUE); 00290 webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(g_browser->web_view), zoom_level); 00291 menu_set_zoom_level(zoom_level); 00292 meta_set_zoom_level(zoom_level); 00293 show_busy(FALSE); 00294 }
void view_show_busy | ( | gboolean | show | ) |
void view_show_error | ( | const gchar * | title, | |
const gchar * | message | |||
) |
Definition at line 223 of file view.c.
References data, g_browser, and LOGPRINTF.
Referenced by download_requested_cb(), and load_error_page().
00224 { 00225 LOGPRINTF("entry"); 00226 00227 gchar *back = NULL; 00228 gchar *data = NULL; 00229 00230 if (webkit_web_view_can_go_back(WEBKIT_WEB_VIEW(g_browser->web_view))) 00231 { 00232 back = g_strdup_printf("<a href=\"javascript:history.go(-1)\">%s</a>", 00233 _("Return to the previous page")); 00234 } 00235 else 00236 { 00237 back = g_strdup(""); 00238 } 00239 00240 data = g_strdup_printf( 00241 "<html><title>%s</title><body>" 00242 "<b>%s</b>" 00243 "<p />%s" 00244 "<p />" 00245 "<p />%s" 00246 "</body></html>", 00247 title, 00248 title, 00249 message, 00250 back); 00251 00252 webkit_web_view_load_html_string(WEBKIT_WEB_VIEW(g_browser->web_view), data, NULL); 00253 00254 g_free(data); 00255 g_free(back); 00256 }
void view_zoom_in | ( | void | ) |
Definition at line 259 of file view.c.
References g_browser, LOGPRINTF, meta_set_zoom_level(), and show_busy().
00260 { 00261 LOGPRINTF("entry"); 00262 00263 show_busy(TRUE); 00264 webkit_web_view_zoom_in(WEBKIT_WEB_VIEW(g_browser->web_view)); 00265 00266 gfloat zoom_level = webkit_web_view_get_zoom_level(WEBKIT_WEB_VIEW(g_browser->web_view)); 00267 meta_set_zoom_level(zoom_level); 00268 show_busy(FALSE); 00269 }
void view_zoom_out | ( | void | ) |
Definition at line 272 of file view.c.
References g_browser, LOGPRINTF, meta_set_zoom_level(), and show_busy().
00273 { 00274 LOGPRINTF("entry"); 00275 00276 show_busy(TRUE); 00277 webkit_web_view_zoom_out(WEBKIT_WEB_VIEW(g_browser->web_view)); 00278 00279 gfloat zoom_level = webkit_web_view_get_zoom_level(WEBKIT_WEB_VIEW(g_browser->web_view)); 00280 meta_set_zoom_level(zoom_level); 00281 show_busy(FALSE); 00282 }