Kaydet (Commit) fdcd5a50 authored tarafından Miklos Vajna's avatar Miklos Vajna

lokdocview.c -> lokdocview.cxx

Otherwise it's not possible to later move the keyboard handling code
from gtktiledviewer to lokdocview, and handling keyboard in
gtktiledviewer but mouse in lokdocview is confusing.

Change-Id: Ib036e2cbf65ffa28771a41b01c0fda2b7b895f47
üst 0262693b
...@@ -14,7 +14,7 @@ $(eval $(call gb_Library_use_externals,libreofficekitgtk,\ ...@@ -14,7 +14,7 @@ $(eval $(call gb_Library_use_externals,libreofficekitgtk,\
gtk \ gtk \
)) ))
$(eval $(call gb_Library_add_cobjects,libreofficekitgtk,\ $(eval $(call gb_Library_add_exception_objects,libreofficekitgtk,\
libreofficekit/source/gtk/lokdocview \ libreofficekit/source/gtk/lokdocview \
)) ))
......
...@@ -273,9 +273,10 @@ SAL_DLLPUBLIC_EXPORT guint lok_docview_get_type() ...@@ -273,9 +273,10 @@ SAL_DLLPUBLIC_EXPORT guint lok_docview_get_type()
if (!lok_docview_type) if (!lok_docview_type)
{ {
char pName[] = "LokDocView";
GtkTypeInfo lok_docview_info = GtkTypeInfo lok_docview_info =
{ {
"LokDocView", pName,
sizeof( LOKDocView ), sizeof( LOKDocView ),
sizeof( LOKDocViewClass ), sizeof( LOKDocViewClass ),
(GtkClassInitFunc) lok_docview_class_init, (GtkClassInitFunc) lok_docview_class_init,
...@@ -375,7 +376,7 @@ static void lok_docview_init( LOKDocView* pDocView ) ...@@ -375,7 +376,7 @@ static void lok_docview_init( LOKDocView* pDocView )
SAL_DLLPUBLIC_EXPORT GtkWidget* lok_docview_new( LibreOfficeKit* pOffice ) SAL_DLLPUBLIC_EXPORT GtkWidget* lok_docview_new( LibreOfficeKit* pOffice )
{ {
LOKDocView* pDocView = gtk_type_new( lok_docview_get_type() ); LOKDocView* pDocView = LOK_DOCVIEW(gtk_type_new(lok_docview_get_type()));
pDocView->pOffice = pOffice; pDocView->pOffice = pOffice;
return GTK_WIDGET( pDocView ); return GTK_WIDGET( pDocView );
} }
...@@ -403,7 +404,7 @@ static gboolean lcl_isEmptyRectangle(GdkRectangle* pRectangle) ...@@ -403,7 +404,7 @@ static gboolean lcl_isEmptyRectangle(GdkRectangle* pRectangle)
/// Takes care of the blinking cursor. /// Takes care of the blinking cursor.
static gboolean lcl_handleTimeout(gpointer pData) static gboolean lcl_handleTimeout(gpointer pData)
{ {
LOKDocView* pDocView = pData; LOKDocView* pDocView = LOK_DOCVIEW(pData);
if (pDocView->m_bEdit) if (pDocView->m_bEdit)
{ {
...@@ -518,7 +519,7 @@ static void lcl_renderGraphicHandle(cairo_t* pCairo, GdkRectangle* pSelection, c ...@@ -518,7 +519,7 @@ static void lcl_renderGraphicHandle(cairo_t* pCairo, GdkRectangle* pSelection, c
static gboolean renderOverlay(GtkWidget* pWidget, GdkEventExpose* pEvent, gpointer pData) static gboolean renderOverlay(GtkWidget* pWidget, GdkEventExpose* pEvent, gpointer pData)
{ {
#if GTK_CHECK_VERSION(2,14,0) // we need gtk_widget_get_window() #if GTK_CHECK_VERSION(2,14,0) // we need gtk_widget_get_window()
LOKDocView* pDocView = pData; LOKDocView* pDocView = LOK_DOCVIEW(pData);
cairo_t* pCairo; cairo_t* pCairo;
(void)pEvent; (void)pEvent;
...@@ -556,7 +557,7 @@ static gboolean renderOverlay(GtkWidget* pWidget, GdkEventExpose* pEvent, gpoint ...@@ -556,7 +557,7 @@ static gboolean renderOverlay(GtkWidget* pWidget, GdkEventExpose* pEvent, gpoint
for (i = pDocView->m_pTextSelectionRectangles; i != NULL; i = i->next) for (i = pDocView->m_pTextSelectionRectangles; i != NULL; i = i->next)
{ {
GdkRectangle* pRectangle = i->data; GdkRectangle* pRectangle = static_cast<GdkRectangle*>(i->data);
// Blue with 75% transparency. // Blue with 75% transparency.
cairo_set_source_rgba(pCairo, ((double)0x43)/255, ((double)0xac)/255, ((double)0xe8)/255, 0.25); cairo_set_source_rgba(pCairo, ((double)0x43)/255, ((double)0xac)/255, ((double)0xe8)/255, 0.25);
cairo_rectangle(pCairo, cairo_rectangle(pCairo,
...@@ -642,7 +643,7 @@ void renderDocument(LOKDocView* pDocView, GdkRectangle* pPartial) ...@@ -642,7 +643,7 @@ void renderDocument(LOKDocView* pDocView, GdkRectangle* pPartial)
gtk_widget_show(pDocView->pTable); gtk_widget_show(pDocView->pTable);
if (pDocView->pCanvas) if (pDocView->pCanvas)
g_free(pDocView->pCanvas); g_free(pDocView->pCanvas);
pDocView->pCanvas = g_malloc0(sizeof(GtkWidget*) * nRows * nColumns); pDocView->pCanvas = static_cast<GtkWidget**>(g_malloc0(sizeof(GtkWidget*) * nRows * nColumns));
} }
// Render the tiles. // Render the tiles.
...@@ -793,7 +794,7 @@ static const gchar* lcl_LibreOfficeKitCallbackTypeToString(int nType) ...@@ -793,7 +794,7 @@ static const gchar* lcl_LibreOfficeKitCallbackTypeToString(int nType)
static gboolean lok_docview_callback(gpointer pData) static gboolean lok_docview_callback(gpointer pData)
{ {
#if GLIB_CHECK_VERSION(2,28,0) // we need g_list_free_full() #if GLIB_CHECK_VERSION(2,28,0) // we need g_list_free_full()
LOKDocViewCallbackData* pCallback = pData; LOKDocViewCallbackData* pCallback = static_cast<LOKDocViewCallbackData*>(pData);
switch (pCallback->m_nType) switch (pCallback->m_nType)
{ {
...@@ -880,7 +881,7 @@ static gboolean lok_docview_callback(gpointer pData) ...@@ -880,7 +881,7 @@ static gboolean lok_docview_callback(gpointer pData)
/// Our LOK callback, runs on the LO thread. /// Our LOK callback, runs on the LO thread.
static void lok_docview_callback_worker(int nType, const char* pPayload, void* pData) static void lok_docview_callback_worker(int nType, const char* pPayload, void* pData)
{ {
LOKDocView* pDocView = pData; LOKDocView* pDocView = static_cast<LOKDocView*>(pData);
LOKDocViewCallbackData* pCallback = g_new0(LOKDocViewCallbackData, 1); LOKDocViewCallbackData* pCallback = g_new0(LOKDocViewCallbackData, 1);
pCallback->m_nType = nType; pCallback->m_nType = nType;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment