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
4d8f12f5
Kaydet (Commit)
4d8f12f5
authored
Eki 18, 2013
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
More text selection WIP hacking
Change-Id: Ia29725295613faf875a688b3917b144a5f05bbe3
üst
5732ff54
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
103 additions
and
61 deletions
+103
-61
touch.h
include/touch/touch.h
+5
-2
View.m
ios/experimental/LibreOffice/LibreOffice/View.m
+76
-41
iosinst.cxx
vcl/ios/iosinst.cxx
+22
-18
No files found.
include/touch/touch.h
Dosyayı görüntüle @
4d8f12f5
...
...
@@ -89,12 +89,17 @@ void touch_ui_selection_none();
// where that is wanted, and this all is work in progress. Prefixed by
// touch_lo_.
typedef
enum
{
DOWN
,
MOVE
,
UP
}
MLOMouseButtonState
;
typedef
enum
{
NONE
,
SHIFT
,
META
}
MLOModifiers
;
typedef
int
MLOModifierMask
;
void
touch_lo_keyboard_did_hide
();
void
touch_lo_runMain
();
void
touch_lo_set_view_size
(
int
width
,
int
height
);
void
touch_lo_render_windows
(
void
*
context
,
int
minX
,
int
minY
,
int
width
,
int
height
);
void
touch_lo_tap
(
int
x
,
int
y
);
void
touch_lo_mouse
(
int
x
,
int
y
,
MLOMouseButtonState
state
,
MLOModifierMask
modifiers
);
void
touch_lo_pan
(
int
deltaX
,
int
deltaY
);
void
touch_lo_zoom
(
int
x
,
int
y
,
float
scale
);
void
touch_lo_keyboard_input
(
int
c
);
...
...
@@ -106,8 +111,6 @@ context, contextHeight, contextWidth specify where to draw.
*/
void
touch_lo_draw_tile
(
void
*
context
,
int
contextWidth
,
int
contextHeight
,
int
tilePosX
,
int
tilePosY
,
int
tileWidth
,
int
tileHeight
);
typedef
enum
{
DOWN
,
MOVE
,
UP
}
MLOMouseButtonState
;
void
touch_lo_mouse_drag
(
int
x
,
int
y
,
MLOMouseButtonState
state
);
void
touch_lo_selection_attempt_resize
(
const
void
*
documentHandle
,
...
...
ios/experimental/LibreOffice/LibreOffice/View.m
Dosyayı görüntüle @
4d8f12f5
...
...
@@ -16,24 +16,12 @@
@property
int
selectionRectangleCount
;
@end
#define HANDLE_BLOB
2
0
#define HANDLE_BLOB
4
0
#define HANDLE_STEM_WIDTH 6
#define HANDLE_STEM_HEIGHT
2
0
#define HANDLE_STEM_HEIGHT
4
0
@implementation
View
#if 0
- (id) initWithFrame:(CGRect)rect
{
self = [super initWithFrame:rect];
if (self) {
self.selectionRectangles = NULL;
self.selectionRectangleCount = 0;
}
return self;
}
#endif
-
(
CGRect
)
topLeftResizeHandle
{
if
(
self
.
selectionRectangleCount
==
0
)
...
...
@@ -166,38 +154,71 @@
-
(
void
)
panGesture
:
(
UIPanGestureRecognizer
*
)
gestureRecognizer
{
static
enum
{
NONE
,
TOPLEFT
,
BOTTOMRIGHT
}
draggedHandle
=
NONE
;
static
CGFloat
previousX
=
0
.
0
f
,
previousY
=
0
.
0
f
;
CGPoint
translation
=
[
gestureRecognizer
translationInView
:
self
];
if
([
gestureRecognizer
numberOfTouches
]
==
1
)
{
if
(
gestureRecognizer
.
state
==
UIGestureRecognizerStateBegan
&&
gestureRecognizer
.
numberOfTouches
==
1
)
{
if
(
CGRectContainsPoint
([
self
topLeftResizeHandle
],
[
gestureRecognizer
locationInView
:
self
]))
{
self
.
selectionRectangles
[
0
].
origin
.
x
+=
translation
.
x
;
self
.
selectionRectangles
[
0
].
origin
.
y
+=
translation
.
y
;
self
.
selectionRectangles
[
0
].
size
.
width
-=
translation
.
x
;
self
.
selectionRectangles
[
0
].
size
.
height
-=
translation
.
y
;
touch_lo_selection_attempt_resize
(
self
.
documentHandle
,
self
.
selectionRectangles
,
self
.
selectionRectangleCount
);
return
;
}
else
if
(
CGRectContainsPoint
([
self
bottomRightResizeHandle
],
[
gestureRecognizer
locationInView
:
self
]))
{
const
int
N
=
self
.
selectionRectangleCount
-
1
;
self
.
selectionRectangles
[
N
].
origin
.
x
+=
translation
.
x
;
self
.
selectionRectangles
[
N
].
origin
.
y
+=
translation
.
y
;
self
.
selectionRectangles
[
N
].
size
.
width
-=
translation
.
x
;
self
.
selectionRectangles
[
N
].
size
.
height
-=
translation
.
y
;
touch_lo_selection_attempt_resize
(
self
.
documentHandle
,
self
.
selectionRectangles
,
self
.
selectionRectangleCount
);
return
;
}
[
gestureRecognizer
locationInView
:
self
]))
draggedHandle
=
TOPLEFT
;
else
if
(
CGRectContainsPoint
([
self
bottomRightResizeHandle
],
[
gestureRecognizer
locationInView
:
self
]))
draggedHandle
=
BOTTOMRIGHT
;
}
if
(
draggedHandle
==
TOPLEFT
)
{
const
int
N
=
self
.
selectionRectangleCount
;
self
.
selectionRectangles
[
0
].
origin
.
x
+=
translation
.
x
;
self
.
selectionRectangles
[
0
].
origin
.
y
+=
translation
.
y
;
self
.
selectionRectangles
[
0
].
size
.
width
-=
translation
.
x
;
self
.
selectionRectangles
[
0
].
size
.
height
-=
translation
.
y
;
#if 0
touch_lo_selection_attempt_resize(self.documentHandle,
self.selectionRectangles,
self.selectionRectangleCount);
#else
touch_lo_mouse
(
self
.
selectionRectangles
[
0
].
origin
.
x
,
self
.
selectionRectangles
[
0
].
origin
.
y
,
DOWN
,
NONE
);
touch_lo_mouse
(
self
.
selectionRectangles
[
N
-
1
].
origin
.
x
+
self
.
selectionRectangles
[
N
-
1
].
size
.
width
,
self
.
selectionRectangles
[
N
-
1
].
origin
.
y
+
self
.
selectionRectangles
[
N
-
1
].
size
.
height
,
UP
,
NONE
);
#endif
if
(
gestureRecognizer
.
state
==
UIGestureRecognizerStateEnded
)
draggedHandle
=
NONE
;
return
;
}
else
if
(
draggedHandle
==
BOTTOMRIGHT
)
{
const
int
N
=
self
.
selectionRectangleCount
;
self
.
selectionRectangles
[
N
-
1
].
origin
.
x
+=
translation
.
x
;
self
.
selectionRectangles
[
N
-
1
].
origin
.
y
+=
translation
.
y
;
self
.
selectionRectangles
[
N
-
1
].
size
.
width
+=
translation
.
x
;
self
.
selectionRectangles
[
N
-
1
].
size
.
height
+=
translation
.
y
;
#if 0
touch_lo_selection_attempt_resize(self.documentHandle,
self.selectionRectangles,
self.selectionRectangleCount);
#else
touch_lo_mouse
(
self
.
selectionRectangles
[
0
].
origin
.
x
,
self
.
selectionRectangles
[
0
].
origin
.
y
,
DOWN
,
NONE
);
touch_lo_mouse
(
self
.
selectionRectangles
[
N
-
1
].
origin
.
x
+
self
.
selectionRectangles
[
N
-
1
].
size
.
width
,
self
.
selectionRectangles
[
N
-
1
].
origin
.
y
+
self
.
selectionRectangles
[
N
-
1
].
size
.
height
,
UP
,
NONE
);
#endif
if
(
gestureRecognizer
.
state
==
UIGestureRecognizerStateEnded
)
draggedHandle
=
NONE
;
return
;
}
if
(
gestureRecognizer
.
state
!=
UIGestureRecognizerStateBegan
)
{
...
...
@@ -238,6 +259,17 @@
}
}
static
int
compare_rects
(
const
void
*
a
,
const
void
*
b
)
{
const
CGRect
*
ra
=
a
;
const
CGRect
*
rb
=
b
;
if
(
ra
->
origin
.
y
!=
rb
->
origin
.
y
)
return
ra
->
origin
.
y
-
rb
->
origin
.
y
;
else
return
ra
->
origin
.
x
-
rb
->
origin
.
x
;
}
-
(
void
)
startSelectionOfType
:
(
MLOSelectionKind
)
kind
withNumber
:
(
int
)
number
ofRectangles
:
(
CGRect
*
)
rects
forDocument
:
(
const
void
*
)
document
{
(
void
)
kind
;
...
...
@@ -257,6 +289,9 @@
self
.
selectionRectangleCount
=
number
;
self
.
documentHandle
=
document
;
// The selection rectangle provided by LO are not sorted in any sane way
qsort
(
self
.
selectionRectangles
,
self
.
selectionRectangleCount
,
sizeof
(
self
.
selectionRectangles
[
0
]),
compare_rects
);
[
self
requestSelectionRedisplay
];
}
...
...
vcl/ios/iosinst.cxx
Dosyayı görüntüle @
4d8f12f5
...
...
@@ -413,48 +413,52 @@ void touch_lo_render_windows(void *context, int minX, int minY, int width, int h
extern
"C"
void
touch_lo_tap
(
int
x
,
int
y
)
{
SalFrame
*
pFocus
=
IosSalInstance
::
getInstance
()
->
getFocusFrame
();
if
(
pFocus
)
{
MouseEvent
aEvent
;
sal_uLong
nEvent
;
aEvent
=
MouseEvent
(
Point
(
x
,
y
),
1
,
MOUSE_SIMPLECLICK
,
MOUSE_LEFT
);
nEvent
=
VCLEVENT_WINDOW_MOUSEBUTTONDOWN
;
Application
::
PostMouseEvent
(
nEvent
,
pFocus
->
GetWindow
(),
&
aEvent
);
nEvent
=
VCLEVENT_WINDOW_MOUSEBUTTONUP
;
Application
::
PostMouseEvent
(
nEvent
,
pFocus
->
GetWindow
(),
&
aEvent
);
}
touch_lo_mouse
(
x
,
y
,
DOWN
,
NONE
);
touch_lo_mouse
(
x
,
y
,
UP
,
NONE
);
}
extern
"C"
void
touch_lo_mouse
_drag
(
int
x
,
int
y
,
MLOMouseButtonState
state
)
void
touch_lo_mouse
(
int
x
,
int
y
,
MLOMouseButtonState
state
,
MLOModifierMask
modifiers
)
{
SalFrame
*
pFocus
=
IosSalInstance
::
getInstance
()
->
getFocusFrame
();
if
(
pFocus
)
{
MouseEvent
aEvent
;
sal_uLong
nEvent
;
sal_uInt16
nModifiers
=
0
;
if
(
modifiers
&
SHIFT
)
nModifiers
|=
KEY_SHIFT
;
if
(
modifiers
&
META
)
nModifiers
|=
KEY_MOD1
;
switch
(
state
)
{
switch
(
state
)
{
case
DOWN
:
aEvent
=
MouseEvent
(
Point
(
x
,
y
),
1
,
MOUSE_SIMPLECLICK
,
MOUSE_LEFT
);
aEvent
=
MouseEvent
(
Point
(
x
,
y
),
1
,
MOUSE_SIMPLECLICK
,
MOUSE_LEFT
,
nModifiers
);
nEvent
=
VCLEVENT_WINDOW_MOUSEBUTTONDOWN
;
break
;
case
MOVE
:
aEvent
=
MouseEvent
(
Point
(
x
,
y
),
1
,
MOUSE_SIMPLEMOVE
,
MOUSE_LEFT
);
aEvent
=
MouseEvent
(
Point
(
x
,
y
),
1
,
MOUSE_SIMPLEMOVE
,
MOUSE_LEFT
,
nModifiers
);
nEvent
=
VCLEVENT_WINDOW_MOUSEMOVE
;
break
;
case
UP
:
aEvent
=
MouseEvent
(
Point
(
x
,
y
),
1
,
MOUSE_SIMPLECLICK
,
MOUSE_LEFT
);
aEvent
=
MouseEvent
(
Point
(
x
,
y
),
1
,
MOUSE_SIMPLECLICK
,
MOUSE_LEFT
,
nModifiers
);
nEvent
=
VCLEVENT_WINDOW_MOUSEBUTTONUP
;
break
;
default
:
assert
(
false
);
}
Application
::
PostMouseEvent
(
nEvent
,
pFocus
->
GetWindow
(),
&
aEvent
);
}
}
extern
"C"
void
touch_lo_mouse_drag
(
int
x
,
int
y
,
MLOMouseButtonState
state
)
{
touch_lo_mouse
(
x
,
y
,
state
,
NONE
);
}
extern
"C"
void
touch_lo_pan
(
int
deltaX
,
int
deltaY
)
{
...
...
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