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
1c8ad3b4
Kaydet (Commit)
1c8ad3b4
authored
Haz 17, 2013
tarafından
siqi
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asynchronsly load image into slideshow
üst
98ae2b23
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
129 additions
and
35 deletions
+129
-35
CommandInterpreter.m
ios/iosremote/iosremote/Communication/CommandInterpreter.m
+1
-1
CommunicationManager.h
ios/iosremote/iosremote/Communication/CommunicationManager.h
+4
-0
CommunicationManager.m
ios/iosremote/iosremote/Communication/CommunicationManager.m
+0
-1
SlideShow.h
ios/iosremote/iosremote/Communication/SlideShow.h
+1
-1
SlideShow.m
ios/iosremote/iosremote/Communication/SlideShow.m
+60
-13
MainStoryboard_iPad.storyboard
...sremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard
+27
-5
libreoffice_sdremoteViewController.m
ios/iosremote/iosremote/libreoffice_sdremoteViewController.m
+8
-2
slideShowViewController.m
ios/iosremote/iosremote/slideShowViewController.m
+28
-12
No files found.
ios/iosremote/iosremote/Communication/CommandInterpreter.m
Dosyayı görüntüle @
1c8ad3b4
...
...
@@ -51,7 +51,7 @@
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
MSG_SLIDE_CHANGED
object
:[
NSNumber
numberWithUnsignedInt
:
currentSlide
]];
}
else
if
([
instruction
isEqualToString
:
@"slideshow_finished"
]){
NSLog
(
@"Interpreter: slideshow_
start
ed"
);
NSLog
(
@"Interpreter: slideshow_
finish
ed"
);
self
.
slideShow
=
[[
SlideShow
alloc
]
init
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
STATUS_CONNECTED_NOSLIDESHOW
object
:
nil
];
}
else
{
...
...
ios/iosremote/iosremote/Communication/CommunicationManager.h
Dosyayı görüntüle @
1c8ad3b4
...
...
@@ -12,6 +12,7 @@
@class
Client
;
@class
Server
;
@class
CommandInterpreter
;
@class
CommandTransmitter
;
@class
SlideShow
;
#define MSG_SLIDESHOW_STARTED @"SLIDESHOW_STARTED"
...
...
@@ -57,5 +58,8 @@ enum ConnectionState : NSInteger {
@property
ConnectionState
state
;
@property
(
nonatomic
,
strong
)
id
delegate
;
@property
(
nonatomic
,
strong
)
CommandInterpreter
*
interpreter
;
@property
(
nonatomic
,
strong
)
CommandTransmitter
*
transmitter
;
+
(
CommunicationManager
*
)
sharedComManager
;
@end
ios/iosremote/iosremote/Communication/CommunicationManager.m
Dosyayı görüntüle @
1c8ad3b4
...
...
@@ -19,7 +19,6 @@
@interface
CommunicationManager
()
@property
(
nonatomic
,
strong
)
Client
*
client
;
@property
(
nonatomic
,
strong
)
CommandTransmitter
*
transmitter
;
@property
(
atomic
,
strong
)
NSMutableSet
*
servers
;
@property
(
nonatomic
,
strong
)
id
connectionConnectedObserver
;
@property
(
nonatomic
,
strong
)
id
connectionDisconnectedObserver
;
...
...
ios/iosremote/iosremote/Communication/SlideShow.h
Dosyayı görüntüle @
1c8ad3b4
...
...
@@ -15,7 +15,7 @@
@property
uint
size
;
@property
uint
currentSlide
;
@property
(
nonatomic
,
strong
)
id
delegate
;
@property
(
nonatomic
,
strong
)
slideShowViewController
*
delegate
;
-
(
void
)
putImage
:
(
NSString
*
)
img
AtIndex
:
(
uint
)
index
;
-
(
void
)
putNotes
:
(
NSString
*
)
notes
AtIndex
:
(
uint
)
index
;
...
...
ios/iosremote/iosremote/Communication/SlideShow.m
Dosyayı görüntüle @
1c8ad3b4
...
...
@@ -14,8 +14,12 @@
@interface
SlideShow
()
@property
(
nonatomic
,
strong
)
NSMutableArray
*
imagesArray
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
notesArray
;
@property
(
nonatomic
,
strong
)
NSMutableDictionary
*
imagesDictionary
;
@property
(
nonatomic
,
strong
)
NSMutableDictionary
*
notesDictionary
;
@property
int
lastRequestedImage
,
lastRequestedNote
;
@property
(
nonatomic
,
strong
)
id
slideShowImageReadyObserver
;
@property
(
nonatomic
,
strong
)
id
slideShowNoteReadyObserver
;
@end
...
...
@@ -29,37 +33,80 @@ dispatch_queue_t backgroundQueue;
-
(
SlideShow
*
)
init
{
self
=
[
super
init
];
self
.
images
Array
=
[[
NSMutableArra
y
alloc
]
init
];
self
.
notes
Array
=
[[
NSMutableArra
y
alloc
]
init
];
self
.
images
Dictionary
=
[[
NSMutableDictionar
y
alloc
]
init
];
self
.
notes
Dictionary
=
[[
NSMutableDictionar
y
alloc
]
init
];
_size
=
0
;
_currentSlide
=
0
;
backgroundQueue
=
dispatch_queue_create
(
"org.libreoffice.iosremote.bgqueue"
,
NULL
);
NSOperationQueue
*
mainQueue
=
[
NSOperationQueue
mainQueue
];
self
.
slideShowImageReadyObserver
=
[[
NSNotificationCenter
defaultCenter
]
addObserverForName
:
@"storage_update_image_ready"
object
:
nil
queue
:
mainQueue
usingBlock
:^
(
NSNotification
*
note
)
{
if
([[[
note
userInfo
]
objectForKey
:
@"index"
]
intValue
]
==
self
.
lastRequestedImage
)
{
[
self
.
delegate
.
image
setImage
:[
self
getImageAtIndex
:
self
.
lastRequestedImage
]];
self
.
lastRequestedImage
=
-
1
;
}
}];
self
.
slideShowNoteReadyObserver
=
[[
NSNotificationCenter
defaultCenter
]
addObserverForName
:
@"storage_update_note_ready"
object
:
nil
queue
:
mainQueue
usingBlock
:^
(
NSNotification
*
note
)
{
if
([[[
note
userInfo
]
objectForKey
:
@"index"
]
intValue
]
==
self
.
lastRequestedNote
)
{
[
self
.
delegate
.
lecturer_notes
loadHTMLString
:[
self
getNotesAtIndex
:
self
.
lastRequestedNote
]
baseURL
:
nil
];
self
.
lastRequestedNote
=
-
1
;
}
}];
return
self
;
}
-
(
void
)
putImage
:
(
NSString
*
)
img
AtIndex
:
(
uint
)
index
{
NSData
*
data
=
[
NSData
dataWithBase64String
:
img
];
UIImage
*
image
=
[
UIImage
imageWithData
:
data
];
[
self
.
imagesArray
insertObject
:
image
atIndex
:
index
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"IMAGE_READY"
object
:
nil
];
// NSLog(@"Put Image into %u", index);
dispatch_async
(
backgroundQueue
,
^
(
void
)
{
NSData
*
data
=
[
NSData
dataWithBase64String
:
img
];
UIImage
*
image
=
[
UIImage
imageWithData
:
data
];
[
self
.
imagesDictionary
setObject
:
image
forKey
:[
NSNumber
numberWithUnsignedInt
:
index
]];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"storage_update_image_ready"
object
:
nil
userInfo
:
[
NSDictionary
dictionaryWithObject
:[
NSNumber
numberWithInt
:
index
]
forKey
:
@"index"
]];
});
}
-
(
void
)
putNotes
:
(
NSString
*
)
notes
AtIndex
:
(
uint
)
index
{
[
self
.
notesArray
insertObject
:
notes
atIndex
:
index
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"NOTE_READY"
object
:
nil
];
// NSLog(@"Put note into %u", index);
[
self
.
notesDictionary
setObject
:
notes
forKey
:[
NSNumber
numberWithUnsignedInt
:
index
]];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"storage_update_note_ready"
object
:
nil
userInfo
:
[
NSDictionary
dictionaryWithObject
:[
NSNumber
numberWithInt
:
index
]
forKey
:
@"index"
]];
}
-
(
UIImage
*
)
getImageAtIndex
:
(
uint
)
index
{
return
[
self
.
imagesArray
objectAtIndex
:
index
];
if
(
!
[
self
.
imagesDictionary
objectForKey
:[
NSNumber
numberWithUnsignedInt
:
index
]])
{
self
.
lastRequestedImage
=
index
;
return
nil
;
}
else
{
self
.
lastRequestedImage
=
-
1
;
return
[
self
.
imagesDictionary
objectForKey
:[
NSNumber
numberWithUnsignedInt
:
index
]];
}
}
-
(
NSString
*
)
getNotesAtIndex
:
(
uint
)
index
{
return
[
self
.
notesArray
objectAtIndex
:
index
];
if
(
!
[
self
.
notesDictionary
objectForKey
:[
NSNumber
numberWithUnsignedInt
:
index
]])
{
self
.
lastRequestedNote
=
index
;
return
nil
;
}
else
{
self
.
lastRequestedNote
=
-
1
;
return
[
self
.
notesDictionary
objectForKey
:[
NSNumber
numberWithUnsignedInt
:
index
]];
}
}
...
...
ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard
Dosyayı görüntüle @
1c8ad3b4
...
...
@@ -9,7 +9,7 @@
<objects>
<viewController
id=
"2"
customClass=
"libreoffice_sdremoteViewController"
sceneMemberID=
"viewController"
>
<view
key=
"view"
contentMode=
"scaleToFill"
id=
"5"
>
<rect
key=
"frame"
x=
"0.0"
y=
"64"
width=
"768"
height=
"9
60
"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"64"
width=
"768"
height=
"9
16
"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<subviews>
<textField
opaque=
"NO"
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"left"
contentVerticalAlignment=
"center"
text=
"192.168.0.22"
borderStyle=
"roundedRect"
minimumFontSize=
"17"
id=
"9w1-Ym-HcF"
>
...
...
@@ -28,6 +28,13 @@
</subviews>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"calibratedWhite"
/>
</view>
<toolbarItems>
<barButtonItem
title=
"Start Presentation"
id=
"R1W-H8-kVN"
>
<connections>
<action
selector=
"startPresentation:"
destination=
"2"
id=
"D8F-FY-mIu"
/>
</connections>
</barButtonItem>
</toolbarItems>
<navigationItem
key=
"navigationItem"
id=
"7ye-Vv-ZD0"
>
<barButtonItem
key=
"rightBarButtonItem"
title=
"Connect"
id=
"ZJB-Ei-Sa9"
>
<connections>
...
...
@@ -35,6 +42,7 @@
</connections>
</barButtonItem>
</navigationItem>
<simulatedToolbarMetrics
key=
"simulatedBottomBarMetrics"
/>
<connections>
<outlet
property=
"ipAddressTextEdit"
destination=
"9w1-Ym-HcF"
id=
"hab-JH-3Lf"
/>
<outlet
property=
"pinLabel"
destination=
"Cg3-f5-zuM"
id=
"HaU-jr-8oJ"
/>
...
...
@@ -126,22 +134,36 @@
<objects>
<viewController
id=
"zdX-BL-bmY"
customClass=
"slideShowViewController"
sceneMemberID=
"viewController"
>
<view
key=
"view"
contentMode=
"scaleToFill"
id=
"Tkv-NW-1bl"
>
<rect
key=
"frame"
x=
"0.0"
y=
"64"
width=
"768"
height=
"9
60
"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"64"
width=
"768"
height=
"9
16
"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<subviews>
<imageView
userInteractionEnabled=
"NO"
contentMode=
"scaleToFill"
id=
"T6z-xu-j8h"
>
<rect
key=
"frame"
x=
"14"
y=
"20"
width=
"741"
height=
"
442
"
/>
<rect
key=
"frame"
x=
"14"
y=
"20"
width=
"741"
height=
"
398
"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
</imageView>
<webView
contentMode=
"scaleToFill"
id=
"y0E-Wp-yUc"
>
<rect
key=
"frame"
x=
"20"
y=
"
513"
width=
"728"
height=
"378
"
/>
<rect
key=
"frame"
x=
"20"
y=
"
487.5"
width=
"728"
height=
"359.5
"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
flexibleMinY=
"YES"
heightSizable=
"YES"
/>
<color
key=
"backgroundColor"
red=
"1"
green=
"1"
blue=
"1"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
</webView>
</subviews>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"calibratedWhite"
/>
</view>
<navigationItem
key=
"navigationItem"
id=
"uc0-p3-wnG"
/>
<toolbarItems>
<barButtonItem
title=
"Previous"
id=
"fEE-h8-5be"
>
<connections>
<action
selector=
"previousSlide:"
destination=
"zdX-BL-bmY"
id=
"DMr-Rh-WfD"
/>
</connections>
</barButtonItem>
</toolbarItems>
<navigationItem
key=
"navigationItem"
id=
"uc0-p3-wnG"
>
<barButtonItem
key=
"rightBarButtonItem"
title=
"Next"
id=
"502-Fp-Hjs"
>
<connections>
<action
selector=
"nextSlide:"
destination=
"zdX-BL-bmY"
id=
"YU1-0k-qPi"
/>
</connections>
</barButtonItem>
</navigationItem>
<simulatedToolbarMetrics
key=
"simulatedBottomBarMetrics"
/>
<connections>
<outlet
property=
"image"
destination=
"T6z-xu-j8h"
id=
"o1L-LM-TbP"
/>
<outlet
property=
"lecturer_notes"
destination=
"y0E-Wp-yUc"
id=
"qNC-Bc-jAZ"
/>
...
...
ios/iosremote/iosremote/libreoffice_sdremoteViewController.m
Dosyayı görüntüle @
1c8ad3b4
...
...
@@ -11,6 +11,7 @@
#import "Server.h"
#import "slideShowViewController.h"
#import "CommunicationManager.h"
#import "CommandTransmitter.h"
#import "CommandInterpreter.h"
@interface
libreoffice_sdremoteViewController
()
...
...
@@ -39,12 +40,12 @@
self
.
slideShowPreviewStartObserver
=
[
self
.
center
addObserverForName
:
STATUS_CONNECTED_SLIDESHOW_RUNNING
object
:
nil
queue
:
mainQueue
usingBlock
:^
(
NSNotification
*
note
)
{
NSLog
(
@"Received performSegue!"
);
[
self
performSegueWithIdentifier
:
@"slidesPreviewSegue"
sender
:
self
];
[
self
performSegueWithIdentifier
:
@"slidesPreviewSegue"
sender
:
self
];
}];
}
-
(
void
)
prepareForSegue
:
(
UIStoryboardSegue
*
)
segue
sender
:
(
id
)
sender
{
-
(
void
)
prepareForSegue
:
(
UIStoryboardSegue
*
)
segue
sender
:
(
id
)
sender
{
if
([
segue
.
identifier
isEqualToString
:
@"slidesPreviewSegue"
])
{
slideShowViewController
*
destViewController
=
segue
.
destinationViewController
;
destViewController
.
slideshow
=
[
self
.
comManager
.
interpreter
slideShow
];
...
...
@@ -67,6 +68,11 @@
[
self
.
comManager
connectToServer
:
self
.
server
];
}
-
(
IBAction
)
startPresentation
:
(
id
)
sender
{
[
self
.
comManager
.
transmitter
startPresentation
];
}
-
(
void
)
viewDidUnload
{
[
self
setIpAddressTextEdit
:
nil
];
[
self
setPinLabel
:
nil
];
...
...
ios/iosremote/iosremote/slideShowViewController.m
Dosyayı görüntüle @
1c8ad3b4
...
...
@@ -8,9 +8,13 @@
#import "slideShowViewController.h"
#import "SlideShow.h"
#import "CommandTransmitter.h"
#import "CommunicationManager.h"
@interface
slideShowViewController
()
@property
(
nonatomic
,
strong
)
CommunicationManager
*
comManager
;
@end
@implementation
slideShowViewController
...
...
@@ -18,6 +22,7 @@
@synthesize
slideshow
=
_slideshow
;
@synthesize
slideShowImageReadyObserver
=
_slideShowImageReadyObserver
;
@synthesize
slideShowNoteReadyObserver
=
_slideShowNoteReadyObserver
;
@synthesize
comManager
=
_comManager
;
-
(
id
)
initWithNibName
:(
NSString
*
)
nibNameOrNil
bundle
:(
NSBundle
*
)
nibBundleOrNil
{
...
...
@@ -34,23 +39,34 @@
NSNotificationCenter
*
center
=
[
NSNotificationCenter
defaultCenter
];
NSOperationQueue
*
mainQueue
=
[
NSOperationQueue
mainQueue
];
// [self.image setImage:[self.slideshow getImageAtIndex:0]];
// [self.lecturer_notes loadHTMLString: [self.slideshow getNotesAtIndex:0]baseURL:nil];
self
.
slideShowImageReadyObserver
=
[
center
addObserverForName
:
@"IMAGE_READY"
object
:
nil
queue
:
mainQueue
usingBlock
:^
(
NSNotification
*
note
)
{
if
([
self
.
slideshow
size
]
==
0
)
NSLog
(
@"Oups"
);
NSLog
(
@"Getting image to display: %@"
,
[
self
.
slideshow
getImageAtIndex
:
0
]);
[
self
.
image
setImage
:[
self
.
slideshow
getImageAtIndex
:
0
]];
self
.
slideShowImageReadyObserver
=
[
center
addObserverForName
:
MSG_SLIDE_CHANGED
object
:
nil
queue
:
mainQueue
usingBlock
:^
(
NSNotification
*
note
)
{
NSLog
(
@"Getting slide: %u image to display: %@"
,
self
.
slideshow
.
currentSlide
,
[
self
.
slideshow
getImageAtIndex
:
self
.
slideshow
.
currentSlide
]);
[
self
.
image
setImage
:[
self
.
slideshow
getImageAtIndex
:
self
.
slideshow
.
currentSlide
]];
[
self
.
lecturer_notes
loadHTMLString
:
[
self
.
slideshow
getNotesAtIndex
:
self
.
slideshow
.
currentSlide
]
baseURL
:
nil
];
}];
self
.
slideShowNoteReadyObserver
=
[
center
addObserverForName
:
@"NOTE_READY"
object
:
nil
queue
:
mainQueue
usingBlock
:^
(
NSNotification
*
note
)
{
NSLog
(
@"Getting note to display: %@"
,
[
self
.
slideshow
getNotesAtIndex
:
0
]);
[
self
.
lecturer_notes
loadHTMLString
:
[
self
.
slideshow
getNotesAtIndex
:
0
]
baseURL
:
nil
];
self
.
slideShowNoteReadyObserver
=
[
center
addObserverForName
:
STATUS_CONNECTED_NOSLIDESHOW
object
:
nil
queue
:
mainQueue
usingBlock
:^
(
NSNotification
*
note
)
{
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}];
self
.
comManager
=
[
CommunicationManager
sharedComManager
];
}
-
(
IBAction
)
nextSlide
:
(
id
)
sender
{
[
self
.
comManager
.
transmitter
nextTransition
];
}
-
(
IBAction
)
previousSlide
:
(
id
)
sender
{
[
self
.
comManager
.
transmitter
previousTransition
];
}
-
(
void
)
didReceiveMemoryWarning
{
...
...
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