Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
986c685e
Kaydet (Commit)
986c685e
authored
Mar 26, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
lokdocview: move motion handling to LOKDocView_Impl
Change-Id: Ibace4a943fb61e2f897c9571cc2c8814935b6e75
üst
00094f9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
32 deletions
+32
-32
lokdocview.cxx
libreofficekit/source/gtk/lokdocview.cxx
+32
-32
No files found.
libreofficekit/source/gtk/lokdocview.cxx
Dosyayı görüntüle @
986c685e
...
...
@@ -121,9 +121,13 @@ struct LOKDocView_Impl
*/
static
void
getDragPoint
(
GdkRectangle
*
pHandle
,
GdkEventButton
*
pEvent
,
GdkPoint
*
pPoint
);
/// Receives a button press event.
static
gboolean
signalButton
(
GtkWidget
*
/*pEventBox*/
,
GdkEventButton
*
pEvent
,
LOKDocView
*
pDocView
);
static
gboolean
signalButton
(
GtkWidget
*
pEventBox
,
GdkEventButton
*
pEvent
,
LOKDocView
*
pDocView
);
/// Implementation of button press event handler, invoked by signalButton().
gboolean
signalButtonImpl
(
GdkEventButton
*
pEvent
);
/// Receives a motion event.
static
gboolean
signalMotion
(
GtkWidget
*
pEventBox
,
GdkEventButton
*
pEvent
,
LOKDocView
*
pDocView
);
/// Implementation of motion event handler, invoked by signalMotion().
gboolean
signalMotionImpl
(
GdkEventButton
*
pEvent
);
};
LOKDocView_Impl
::
LOKDocView_Impl
(
LOKDocView
*
pDocView
)
...
...
@@ -251,7 +255,7 @@ gboolean LOKDocView_Impl::signalButton(GtkWidget* /*pEventBox*/, GdkEventButton*
/// Receives a button press event.
gboolean
LOKDocView_Impl
::
signalButtonImpl
(
GdkEventButton
*
pEvent
)
{
g_info
(
"LOKDocView_Impl::s
s
ignalButton: %d, %d (in twips: %d, %d)"
,
(
int
)
pEvent
->
x
,
(
int
)
pEvent
->
y
,
(
int
)
pixelToTwip
(
pEvent
->
x
),
(
int
)
pixelToTwip
(
pEvent
->
y
));
g_info
(
"LOKDocView_Impl::signalButton: %d, %d (in twips: %d, %d)"
,
(
int
)
pEvent
->
x
,
(
int
)
pEvent
->
y
,
(
int
)
pixelToTwip
(
pEvent
->
x
),
(
int
)
pixelToTwip
(
pEvent
->
y
));
if
(
pEvent
->
type
==
GDK_BUTTON_RELEASE
)
{
...
...
@@ -382,74 +386,70 @@ void LOKDocView_Impl::getDragPoint(GdkRectangle* pHandle, GdkEventButton* pEvent
pPoint
->
y
=
aCursor
.
y
+
(
pEvent
->
y
-
aHandle
.
y
);
}
static
void
lok_docview_class_init
(
gpointer
);
static
void
lok_docview_init
(
GTypeInstance
*
,
gpointer
);
static
gboolean
renderOverlay
(
GtkWidget
*
pWidget
,
GdkEventExpose
*
pEvent
,
gpointer
pData
);
gboolean
LOKDocView_Impl
::
signalMotion
(
GtkWidget
*
/*pEventBox*/
,
GdkEventButton
*
pEvent
,
LOKDocView
*
pDocView
)
{
return
pDocView
->
m_pImpl
->
signalMotionImpl
(
pEvent
);
}
gboolean
lcl_signalMotion
(
GtkWidget
*
/*pEventBox*/
,
GdkEventButton
*
pEvent
,
LOKDocView
*
pDocView
)
gboolean
LOKDocView_Impl
::
signalMotionImpl
(
GdkEventButton
*
pEvent
)
{
GdkPoint
aPoint
;
if
(
pDocView
->
m_pImpl
->
m_bInDragMiddleHandle
)
if
(
m_bInDragMiddleHandle
)
{
g_info
(
"lcl_signalMotion: dragging the middle handle"
);
LOKDocView_Impl
::
getDragPoint
(
&
pDocView
->
m_pImpl
->
m_aHandleMiddleRect
,
pEvent
,
&
aPoint
);
pDocView
->
m_pImpl
->
m_pDocument
->
pClass
->
setTextSelection
(
pDocView
->
m_pImpl
->
m_pDocument
,
LOK_SETTEXTSELECTION_RESET
,
pDocView
->
m_pImpl
->
pixelToTwip
(
aPoint
.
x
),
pDocView
->
m_pImpl
->
pixelToTwip
(
aPoint
.
y
));
LOKDocView_Impl
::
getDragPoint
(
&
m_aHandleMiddleRect
,
pEvent
,
&
aPoint
);
m_pDocument
->
pClass
->
setTextSelection
(
m_pDocument
,
LOK_SETTEXTSELECTION_RESET
,
pixelToTwip
(
aPoint
.
x
),
pixelToTwip
(
aPoint
.
y
));
return
FALSE
;
}
if
(
pDocView
->
m_pImpl
->
m_bInDragStartHandle
)
if
(
m_bInDragStartHandle
)
{
g_info
(
"lcl_signalMotion: dragging the start handle"
);
LOKDocView_Impl
::
getDragPoint
(
&
pDocView
->
m_pImpl
->
m_aHandleStartRect
,
pEvent
,
&
aPoint
);
pDocView
->
m_pImpl
->
m_pDocument
->
pClass
->
setTextSelection
(
pDocView
->
m_pImpl
->
m_pDocument
,
LOK_SETTEXTSELECTION_START
,
pDocView
->
m_pImpl
->
pixelToTwip
(
aPoint
.
x
),
pDocView
->
m_pImpl
->
pixelToTwip
(
aPoint
.
y
));
LOKDocView_Impl
::
getDragPoint
(
&
m_aHandleStartRect
,
pEvent
,
&
aPoint
);
m_pDocument
->
pClass
->
setTextSelection
(
m_pDocument
,
LOK_SETTEXTSELECTION_START
,
pixelToTwip
(
aPoint
.
x
),
pixelToTwip
(
aPoint
.
y
));
return
FALSE
;
}
if
(
pDocView
->
m_pImpl
->
m_bInDragEndHandle
)
if
(
m_bInDragEndHandle
)
{
g_info
(
"lcl_signalMotion: dragging the end handle"
);
LOKDocView_Impl
::
getDragPoint
(
&
pDocView
->
m_pImpl
->
m_aHandleEndRect
,
pEvent
,
&
aPoint
);
pDocView
->
m_pImpl
->
m_pDocument
->
pClass
->
setTextSelection
(
pDocView
->
m_pImpl
->
m_pDocument
,
LOK_SETTEXTSELECTION_END
,
pDocView
->
m_pImpl
->
pixelToTwip
(
aPoint
.
x
),
pDocView
->
m_pImpl
->
pixelToTwip
(
aPoint
.
y
));
LOKDocView_Impl
::
getDragPoint
(
&
m_aHandleEndRect
,
pEvent
,
&
aPoint
);
m_pDocument
->
pClass
->
setTextSelection
(
m_pDocument
,
LOK_SETTEXTSELECTION_END
,
pixelToTwip
(
aPoint
.
x
),
pixelToTwip
(
aPoint
.
y
));
return
FALSE
;
}
for
(
int
i
=
0
;
i
<
GRAPHIC_HANDLE_COUNT
;
++
i
)
{
if
(
pDocView
->
m_pImpl
->
m_bInDragGraphicHandles
[
i
])
if
(
m_bInDragGraphicHandles
[
i
])
{
g_info
(
"lcl_signalMotion: dragging the graphic handle #%d"
,
i
);
return
FALSE
;
}
}
if
(
pDocView
->
m_pImpl
->
m_bInDragGraphicSelection
)
if
(
m_bInDragGraphicSelection
)
{
g_info
(
"lcl_signalMotion: dragging the graphic selection"
);
return
FALSE
;
}
GdkRectangle
aMotionInTwipsInTwips
;
aMotionInTwipsInTwips
.
x
=
p
DocView
->
m_pImpl
->
p
ixelToTwip
(
pEvent
->
x
);
aMotionInTwipsInTwips
.
y
=
p
DocView
->
m_pImpl
->
p
ixelToTwip
(
pEvent
->
y
);
aMotionInTwipsInTwips
.
x
=
pixelToTwip
(
pEvent
->
x
);
aMotionInTwipsInTwips
.
y
=
pixelToTwip
(
pEvent
->
y
);
aMotionInTwipsInTwips
.
width
=
1
;
aMotionInTwipsInTwips
.
height
=
1
;
if
(
gdk_rectangle_intersect
(
&
aMotionInTwipsInTwips
,
&
pDocView
->
m_pImpl
->
m_aGraphicSelection
,
0
))
if
(
gdk_rectangle_intersect
(
&
aMotionInTwipsInTwips
,
&
m_aGraphicSelection
,
0
))
{
g_info
(
"lcl_signalMotion: start of drag graphic selection"
);
pDocView
->
m_pImpl
->
m_bInDragGraphicSelection
=
true
;
pDocView
->
m_pImpl
->
m_pDocument
->
pClass
->
setGraphicSelection
(
pDocView
->
m_pImpl
->
m_pDocument
,
LOK_SETGRAPHICSELECTION_START
,
pDocView
->
m_pImpl
->
pixelToTwip
(
pEvent
->
x
),
pDocView
->
m_pImpl
->
pixelToTwip
(
pEvent
->
y
));
m_bInDragGraphicSelection
=
true
;
m_pDocument
->
pClass
->
setGraphicSelection
(
m_pDocument
,
LOK_SETGRAPHICSELECTION_START
,
pixelToTwip
(
pEvent
->
x
),
pixelToTwip
(
pEvent
->
y
));
return
FALSE
;
}
return
FALSE
;
}
static
void
lok_docview_class_init
(
gpointer
);
static
void
lok_docview_init
(
GTypeInstance
*
,
gpointer
);
static
gboolean
renderOverlay
(
GtkWidget
*
pWidget
,
GdkEventExpose
*
pEvent
,
gpointer
pData
);
SAL_DLLPUBLIC_EXPORT
guint
lok_docview_get_type
()
{
static
guint
lok_docview_type
=
0
;
...
...
@@ -514,7 +514,7 @@ static void lok_docview_init( GTypeInstance* pInstance, gpointer )
gtk_widget_set_events
(
pDocView
->
m_pImpl
->
m_pEventBox
,
GDK_BUTTON_PRESS_MASK
);
// So that drag doesn't try to move the whole window.
gtk_signal_connect
(
GTK_OBJECT
(
pDocView
->
m_pImpl
->
m_pEventBox
),
"button-press-event"
,
GTK_SIGNAL_FUNC
(
LOKDocView_Impl
::
signalButton
),
pDocView
);
gtk_signal_connect
(
GTK_OBJECT
(
pDocView
->
m_pImpl
->
m_pEventBox
),
"button-release-event"
,
GTK_SIGNAL_FUNC
(
LOKDocView_Impl
::
signalButton
),
pDocView
);
gtk_signal_connect
(
GTK_OBJECT
(
pDocView
->
m_pImpl
->
m_pEventBox
),
"motion-notify-event"
,
GTK_SIGNAL_FUNC
(
lcl_
signalMotion
),
pDocView
);
gtk_signal_connect
(
GTK_OBJECT
(
pDocView
->
m_pImpl
->
m_pEventBox
),
"motion-notify-event"
,
GTK_SIGNAL_FUNC
(
LOKDocView_Impl
::
signalMotion
),
pDocView
);
gtk_widget_show
(
pDocView
->
m_pImpl
->
m_pEventBox
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment