#include <liberipc/eripc.h>
#include <liberipc/eripcpagebar.h>
#include "browserTypes.h"
#include "pagebar.h"
#include "indexFileHandler.h"
#include "browserLog.h"
#include "erbusy.h"
Go to the source code of this file.
Functions | |
| void | pagebar_init () |
| void | pagebar_goto_page (int page) |
| void | pagebar_set_pagecount (int count) |
| void | pagebar_set_offset (int offset) |
| void | pagebar_redraw () |
| void | browser_pagebar_page_selected (int pagenumber, Ereader *browser) |
| BrowserPageStatus * | browser_create_page_status (void) |
| void | browser_destroy_page_status (BrowserPageStatus *pageStatus) |
| gboolean | browser_set_page_status_indexfile (BrowserPageStatus *pageStatus, char *indexfile) |
| gboolean | page_status_handle_type_update (BrowserPageStatus *pageStatus, gchar *pageType) |
Variables | |
| static erClientChannel_t | erPagebarChannel |
<File description>="">
Definition in file pagebar.cpp.
| BrowserPageStatus* browser_create_page_status | ( | void | ) |
creation and initalistaion of the BrowserPageStatus structure
Definition at line 139 of file pagebar.cpp.
00140 { 00141 BrowserPageStatus *pageStatus = NULL; 00142 00143 // create one BrowserPageStatus ereader struct and fill it with zeros 00144 pageStatus = g_new0(BrowserPageStatus, 1); 00145 00146 if (pageStatus) 00147 { 00148 pageStatus->currentType = g_strdup(INIT_PAGE_TYPE); 00149 pageStatus->currentPage = -1; 00150 pageStatus->pageCount = -1; 00151 } 00152 00153 BR_PAGEBARPRINTF("0x%x", pageStatus); 00154 00155 return pageStatus; 00156 }
| void browser_destroy_page_status | ( | BrowserPageStatus * | pageStatus | ) |
free memory used by pageStatus and lcose the currenly used indexfile
| pageStatus | reference to struct containing current browser page status |
Definition at line 159 of file pagebar.cpp.
00160 { 00161 BR_PAGEBARPRINTF("entry 0x%x", pageStatus); 00162 00163 if (pageStatus) 00164 { 00165 if (pageStatus->index.pagelist) 00166 { 00167 index_file_close(&pageStatus->index); 00168 } 00169 if (pageStatus->currentType) 00170 { 00171 // free string allocated with g_strdup 00172 g_free(pageStatus->currentType); 00173 } 00174 00175 g_free(pageStatus); 00176 } 00177 }

| void browser_pagebar_page_selected | ( | int | pagenumber, | |
| Ereader * | browser | |||
| ) |
THIS NEEDS A PROPER DESCRIPTION
| pagenumber | the newly selected page bar page | |
| Ereader | datastructure containing the "mozembed" reference and the current page status |
Definition at line 77 of file pagebar.cpp.
00078 { 00079 gchar *location = NULL; 00080 gchar *pointer; 00081 00082 BR_PAGEBARPRINTF("number %d -- Ereader pointer 0x%x ", pagenumber, (unsigned int) browser); 00083 00084 if (pagenumber > 0) 00085 { 00086 location = index_file_get_page_location(&browser->pageStatus->index, browser->pageStatus->currentType, pagenumber); 00087 00088 if (location) 00089 { 00090 gchar *absolute_new_location; 00091 gchar *end; 00092 int length; 00093 00094 BR_PAGEBARPRINTF("gtk_moz_embed_load_url %s", location); 00095 00096 end = strrchr(browser->pageStatus->manifestFile, '/'); 00097 00098 if (end) 00099 { 00100 // size manifestfile path + last / 00101 length = (end - browser->pageStatus->manifestFile) + 1; 00102 00103 BR_PAGEBARPRINTF("path lenght %d", length); 00104 00105 absolute_new_location = (char *) g_malloc0(length + strlen(location)); 00106 00107 memcpy(absolute_new_location, browser->pageStatus->manifestFile, length); 00108 00109 BR_PAGEBARPRINTF("location %s", location); 00110 BR_PAGEBARPRINTF("absolute_new_location %s", absolute_new_location); 00111 00112 strcat(absolute_new_location, location); 00113 00114 BR_PAGEBARPRINTF("gtk_moz_embed_load_url %s [%d]", absolute_new_location, strlen(absolute_new_location)); 00115 00116 BR_LOGPRINTF("BUSY ON"); 00117 erbusy_blink(); 00118 gtk_moz_embed_load_url(GTK_MOZ_EMBED(browser->mozEmbed), absolute_new_location); 00119 00120 // free the allocated memory 00121 g_free(absolute_new_location); 00122 } 00123 } 00124 else 00125 { 00126 BR_PAGEBARPRINTF("location = null"); 00127 // reload the current page 00128 //erbusy_request(1); 00129 //gtk_moz_embed_reload(GTK_MOZ_EMBED(browser->mozEmbed), GTK_MOZ_EMBED_FLAG_RELOADNORMAL); 00130 } 00131 } 00132 else 00133 { 00134 BR_PAGEBARPRINTF("invalid pagenumber %d", pagenumber); 00135 } 00136 00137 }

| gboolean browser_set_page_status_indexfile | ( | BrowserPageStatus * | pageStatus, | |
| char * | indexfile | |||
| ) |
open the specified index file and update the reference in the pageStatus (closes the currently selected index file)
| pageStatus | reference to struct containing current browser page status | |
| indexfile | index file name |
Definition at line 179 of file pagebar.cpp.
00180 { 00181 gboolean returnValue = FALSE; 00182 00183 BR_PAGEBARPRINTF("entry 0x%x file %s", pageStatus, indexfile); 00184 00185 if (pageStatus && indexfile) 00186 { 00187 //init the index file used for page handling 00188 if (pageStatus->index.pagelist) 00189 { 00190 index_file_close(&pageStatus->index); 00191 } 00192 00193 if (0 == index_file_init(indexfile, &pageStatus->index)) 00194 { 00195 pageStatus->manifestFile = indexfile; 00196 returnValue = TRUE; 00197 } 00198 } 00199 else 00200 { 00201 BR_ERRORPRINTF("input parameter == NULL"); 00202 } 00203 return returnValue; 00204 }

| gboolean page_status_handle_type_update | ( | BrowserPageStatus * | pageStatus, | |
| gchar * | pageType | |||
| ) |
updates the pageStatus when the pageType differs from current pageStatus pagetype return TRUE when the type was changed, FALSE when no type update was needed
| pageStatus | reference to struct containing current browser page status | |
| pageType | the page type |
Definition at line 207 of file pagebar.cpp.
00208 { 00209 gint result = -1; 00210 00211 if (*pageType) 00212 { 00213 BR_PAGEBARPRINTF("currentType %s --> type %s", pageStatus->currentType, pageType); 00214 00215 if (pageStatus->currentType) 00216 { 00217 result = strcmp(pageStatus->currentType, pageType); 00218 } 00219 00220 if (result == 0) 00221 { 00222 BR_PAGEBARPRINTF("no type update"); 00223 BR_PAGEBARPRINTF("no page bar update needed => new page number => returning FALSE!!!"); 00224 return FALSE; 00225 00226 } 00227 else 00228 { 00229 BR_PAGEBARPRINTF("type update from %s to %s", pageStatus->currentType, pageType); 00230 00231 if (pageStatus->currentType) 00232 { 00233 g_free(pageStatus->currentType); 00234 pageStatus->currentType = NULL; 00235 } 00236 00237 pageStatus->currentType = g_strdup(pageType); 00238 00239 BR_PAGEBARPRINTF("page bar update needed (%s) => new page bar, new page number => returning TRUE !!!", pageStatus->currentType); 00240 return TRUE; 00241 } 00242 } 00243 00244 return TRUE; 00245 }
| void pagebar_goto_page | ( | int | page | ) |
Request from browser to goto page
| page | - page to go to |
Definition at line 49 of file pagebar.cpp.
00050 { 00051 BR_PAGEBARPRINTF("entry %d", page); 00052 pbSetCurrentPage(erPagebarChannel, ER_XHTML_VIEWER_UA_ID, page); 00053 }

| void pagebar_init | ( | ) |
Open communication channel with pageBar deamon counts on the fact that pageBar is running
Definition at line 41 of file pagebar.cpp.
00042 { 00043 BR_PAGEBARPRINTF("entry"); 00044 erIpcStartClient(ER_PAGEBAR_CHANNEL, &erPagebarChannel); 00045 pbReset(erPagebarChannel, ER_XHTML_VIEWER_UA_ID); 00046 }

| void pagebar_redraw | ( | ) |
Request from contentLister to redraw pagebar
| - |
Definition at line 71 of file pagebar.cpp.
00072 { 00073 BR_PAGEBARPRINTF("redraw"); 00074 pbRedraw(erPagebarChannel, ER_XHTML_VIEWER_UA_ID); 00075 }

| void pagebar_set_offset | ( | int | offset | ) |
Request from browser to set (scroll)offset of current page
| offset | - scrolled offset in current page |
Definition at line 64 of file pagebar.cpp.
00065 { 00066 BR_PAGEBARPRINTF("entry %d", offset); 00067 pbSetCurrentPageOffset(erPagebarChannel, ER_XHTML_VIEWER_UA_ID, offset); 00068 }

| void pagebar_set_pagecount | ( | int | count | ) |
Request from browser to set number of pages
| count | - number of pages in current view |
Definition at line 56 of file pagebar.cpp.
00057 { 00058 BR_PAGEBARPRINTF("entry %d", count); 00059 pbSetPageCount(erPagebarChannel, ER_XHTML_VIEWER_UA_ID, count); 00060 00061 }

erClientChannel_t erPagebarChannel [static] |
Definition at line 38 of file pagebar.cpp.
1.5.6