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
65726aae
Kaydet (Commit)
65726aae
authored
Mar 10, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
LOK: add lok::Document::setGraphicSelection() API and implement it for Writer
Change-Id: I115cf7e7978622d5108c4c792f7de861beb6efb6
üst
c08069f2
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
107 additions
and
0 deletions
+107
-0
init.cxx
desktop/source/lib/init.cxx
+17
-0
LibreOfficeKit.h
include/LibreOfficeKit/LibreOfficeKit.h
+5
-0
LibreOfficeKit.hxx
include/LibreOfficeKit/LibreOfficeKit.hxx
+12
-0
LibreOfficeKitEnums.h
include/LibreOfficeKit/LibreOfficeKitEnums.h
+25
-0
ITiledRenderable.hxx
include/vcl/ITiledRenderable.hxx
+7
-0
unotxdoc.hxx
sw/inc/unotxdoc.hxx
+2
-0
edtwin.cxx
sw/source/uibase/docvw/edtwin.cxx
+18
-0
edtwin.hxx
sw/source/uibase/inc/edtwin.hxx
+2
-0
unotxdoc.cxx
sw/source/uibase/uno/unotxdoc.cxx
+19
-0
No files found.
desktop/source/lib/init.cxx
Dosyayı görüntüle @
65726aae
...
...
@@ -217,6 +217,10 @@ static void doc_setTextSelection (LibreOfficeKitDocument* pThis,
int
nType
,
int
nX
,
int
nY
);
static
void
doc_setGraphicSelection
(
LibreOfficeKitDocument
*
pThis
,
int
nType
,
int
nX
,
int
nY
);
struct
LibLODocument_Impl
:
public
_LibreOfficeKitDocument
{
...
...
@@ -247,6 +251,7 @@ struct LibLODocument_Impl : public _LibreOfficeKitDocument
m_pDocumentClass
->
postKeyEvent
=
doc_postKeyEvent
;
m_pDocumentClass
->
postMouseEvent
=
doc_postMouseEvent
;
m_pDocumentClass
->
setTextSelection
=
doc_setTextSelection
;
m_pDocumentClass
->
setGraphicSelection
=
doc_setGraphicSelection
;
gDocumentClass
=
m_pDocumentClass
;
}
...
...
@@ -740,6 +745,18 @@ static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int n
pDoc
->
setTextSelection
(
nType
,
nX
,
nY
);
}
static
void
doc_setGraphicSelection
(
LibreOfficeKitDocument
*
pThis
,
int
nType
,
int
nX
,
int
nY
)
{
ITiledRenderable
*
pDoc
=
getTiledRenderable
(
pThis
);
if
(
!
pDoc
)
{
gImpl
->
maLastExceptionMsg
=
"Document doesn't support tiled rendering"
;
return
;
}
pDoc
->
setGraphicSelection
(
nType
,
nX
,
nY
);
}
static
char
*
lo_getError
(
LibreOfficeKit
*
pThis
)
{
LibLibreOffice_Impl
*
pLib
=
static_cast
<
LibLibreOffice_Impl
*>
(
pThis
);
...
...
include/LibreOfficeKit/LibreOfficeKit.h
Dosyayı görüntüle @
65726aae
...
...
@@ -137,6 +137,11 @@ struct _LibreOfficeKitDocumentClass
int
nType
,
int
nX
,
int
nY
);
/// @see lok::Document::setGraphicSelection
void
(
*
setGraphicSelection
)(
LibreOfficeKitDocument
*
pThis
,
int
nType
,
int
nX
,
int
nY
);
#endif // LOK_USE_UNSTABLE_API
};
...
...
include/LibreOfficeKit/LibreOfficeKit.hxx
Dosyayı görüntüle @
65726aae
...
...
@@ -141,6 +141,18 @@ public:
{
mpDoc
->
pClass
->
setTextSelection
(
mpDoc
,
nType
,
nX
,
nY
);
}
/**
* Adjusts the graphic selection.
*
* @param nType @see LibreOfficeKitSetGraphicSelectionType
* @param nX horizontal position in document coordinates
* @param nY vertical position in document coordinates
*/
inline
void
setGraphicSelection
(
int
nType
,
int
nX
,
int
nY
)
{
mpDoc
->
pClass
->
setGraphicSelection
(
mpDoc
,
nType
,
nX
,
nY
);
}
#endif // LOK_USE_UNSTABLE_API
};
...
...
include/LibreOfficeKit/LibreOfficeKitEnums.h
Dosyayı görüntüle @
65726aae
...
...
@@ -135,6 +135,31 @@ typedef enum
}
LibreOfficeKitSetTextSelectionType
;
typedef
enum
{
/**
* A move or a resize action starts. It is assumed that there is a valid
* graphic selection (see LOK_CALLBACK_GRAPHIC_SELECTION) and the supplied
* coordinates are the ones the user tapped on.
*
* The type of the action is move by default, unless the coordinates are
* the position of a handle (see below), in which case it's a resize.
*
* There are 8 handles for a graphic selection:
* - top-left, top-center, top-right
* - middle-left, middle-right
* - bottom-left, bottom-center, bottom-right
*/
LOK_SETGRAPHICSELECTION_START
,
/**
* A move or resize action stops. It is assumed that this is always used
* only after a LOK_SETTEXTSELECTION_START. The supplied coordinates are
* the ones where the user released the screen.
*/
LOK_SETGRAPHICSELECTION_END
}
LibreOfficeKitSetGraphicSelectionType
;
#endif // LOK_USE_UNSTABLE_API
#ifdef __cplusplus
...
...
include/vcl/ITiledRenderable.hxx
Dosyayı görüntüle @
65726aae
...
...
@@ -115,6 +115,13 @@ public:
* @see lok::Document::setTextSelection().
*/
virtual
void
setTextSelection
(
int
/*nType*/
,
int
/*nX*/
,
int
/*nY*/
)
{
}
/**
* Adjusts the graphic selection.
*
* @see lok::Document::setGraphicSelection().
*/
virtual
void
setGraphicSelection
(
int
/*nType*/
,
int
/*nX*/
,
int
/*nY*/
)
{
}
};
}
// namespace vcl
...
...
sw/inc/unotxdoc.hxx
Dosyayı görüntüle @
65726aae
...
...
@@ -417,6 +417,8 @@ public:
virtual
void
postMouseEvent
(
int
nType
,
int
nX
,
int
nY
,
int
nCount
)
SAL_OVERRIDE
;
/// @see vcl::ITiledRenderable::setTextSelection().
virtual
void
setTextSelection
(
int
nType
,
int
nX
,
int
nY
)
SAL_OVERRIDE
;
/// @see vcl::ITiledRenderable::setGraphicSelection().
virtual
void
setGraphicSelection
(
int
nType
,
int
nX
,
int
nY
)
SAL_OVERRIDE
;
void
Invalidate
();
void
Reactivate
(
SwDocShell
*
pNewDocShell
);
...
...
sw/source/uibase/docvw/edtwin.cxx
Dosyayı görüntüle @
65726aae
...
...
@@ -6283,4 +6283,22 @@ void SwEditWin::SetCursorLogicPosition(const Point& rPosition, bool bPoint, bool
rShell
.
getShellCrsr
(
/*bBlock=*/
false
)
->
Exchange
();
}
void
SwEditWin
::
SetGraphicLogicPosition
(
bool
bStart
,
const
Point
&
rPosition
)
{
if
(
bStart
)
{
MouseEvent
aClickEvent
(
rPosition
,
1
,
MouseEventModifiers
::
SIMPLECLICK
,
MOUSE_LEFT
);
MouseButtonDown
(
aClickEvent
);
MouseEvent
aMoveEvent
(
Point
(
rPosition
.
getX
()
+
MIN_MOVE
+
1
,
rPosition
.
getY
()),
0
,
MouseEventModifiers
::
SIMPLEMOVE
,
MOUSE_LEFT
);
MouseMove
(
aMoveEvent
);
}
else
{
MouseEvent
aMoveEvent
(
Point
(
rPosition
.
getX
()
-
MIN_MOVE
-
1
,
rPosition
.
getY
()),
0
,
MouseEventModifiers
::
SIMPLEMOVE
,
MOUSE_LEFT
);
MouseMove
(
aMoveEvent
);
MouseEvent
aClickEvent
(
rPosition
,
1
,
MouseEventModifiers
::
SIMPLECLICK
,
MOUSE_LEFT
);
MouseButtonUp
(
aClickEvent
);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sw/source/uibase/inc/edtwin.hxx
Dosyayı görüntüle @
65726aae
...
...
@@ -308,6 +308,8 @@ public:
void
LogicMouseButtonUp
(
const
MouseEvent
&
rMouseEvent
);
/// Allows adjusting the point or mark of the selection to a document coordinate.
void
SetCursorLogicPosition
(
const
Point
&
rPosition
,
bool
bPoint
,
bool
bClearMark
);
/// Allows starting or ending a graphic move or resize action.
void
SetGraphicLogicPosition
(
bool
bStart
,
const
Point
&
rPosition
);
};
#endif
...
...
sw/source/uibase/uno/unotxdoc.cxx
Dosyayı görüntüle @
65726aae
...
...
@@ -3223,6 +3223,25 @@ void SwXTextDocument::setTextSelection(int nType, int nX, int nY)
}
}
void
SwXTextDocument
::
setGraphicSelection
(
int
nType
,
int
nX
,
int
nY
)
{
SolarMutexGuard
aGuard
;
SwEditWin
&
rEditWin
=
pDocShell
->
GetView
()
->
GetEditWin
();
switch
(
nType
)
{
case
LOK_SETTEXTSELECTION_START
:
rEditWin
.
SetGraphicLogicPosition
(
/*bStart=*/
true
,
Point
(
nX
,
nY
));
break
;
case
LOK_SETTEXTSELECTION_END
:
rEditWin
.
SetGraphicLogicPosition
(
/*bStart=*/
false
,
Point
(
nX
,
nY
));
break
;
default
:
assert
(
false
);
break
;
}
}
void
*
SAL_CALL
SwXTextDocument
::
operator
new
(
size_t
t
)
throw
()
{
return
SwXTextDocumentBaseClass
::
operator
new
(
t
);
...
...
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