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
57058331
Kaydet (Commit)
57058331
authored
Haz 11, 2013
tarafından
siqi
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
slides preview works
üst
16c554e7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
134 additions
and
121 deletions
+134
-121
Base64.h
ios/iosremote/iosremote/Base64.h
+11
-23
Base64.m
ios/iosremote/iosremote/Base64.m
+13
-87
CommandInterpreter.m
ios/iosremote/iosremote/Communication/CommandInterpreter.m
+2
-4
CommandTransmitter.m
ios/iosremote/iosremote/Communication/CommandTransmitter.m
+3
-3
CommunicationManager.h
ios/iosremote/iosremote/Communication/CommunicationManager.h
+11
-0
CommunicationManager.m
ios/iosremote/iosremote/Communication/CommunicationManager.m
+38
-0
SlideShow.h
ios/iosremote/iosremote/Communication/SlideShow.h
+3
-0
SlideShow.m
ios/iosremote/iosremote/Communication/SlideShow.m
+17
-2
MainStoryboard_iPad.storyboard
...sremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard
+0
-0
libreoffice_sdremoteViewController.m
ios/iosremote/iosremote/libreoffice_sdremoteViewController.m
+9
-1
slideShowViewController.h
ios/iosremote/iosremote/slideShowViewController.h
+6
-0
slideShowViewController.m
ios/iosremote/iosremote/slideShowViewController.m
+21
-1
No files found.
ios/iosremote/iosremote/Base64.h
Dosyayı görüntüle @
57058331
//
// Base64.h
// CryptTest
//
// Created by Kiichi Takeuchi on 4/20/10.
// Copyright 2010 ObjectGraph LLC. All rights reserved.
//
// Original Source Code is donated by Cyrus
// Public Domain License
// http://www.cocoadev.com/index.pl?BaseSixtyFour
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#import <Foundation/Foundation.h>
@interface
Base64
:
NSObject
{
@interface
NSData
(
Base64
)
}
+
(
id
)
dataWithBase64String
:(
NSString
*
)
base64String
;
+
(
void
)
initialize
;
+
(
NSString
*
)
encode
:(
const
uint8_t
*
)
input
length
:
(
NSInteger
)
length
;
+
(
NSString
*
)
encode
:(
NSData
*
)
rawBytes
;
+
(
NSData
*
)
decode
:(
const
char
*
)
string
length
:
(
NSInteger
)
inputLength
;
+
(
NSData
*
)
decode
:(
NSString
*
)
string
;
@end
@end
\ No newline at end of file
ios/iosremote/iosremote/Base64.m
Dosyayı görüntüle @
57058331
/
/
// Base64.m
// CryptTest
//
// Created by Kiichi Takeuchi on 4/20/10.
// Copyright 2010 ObjectGraph LLC. All rights reserved
.
/
/
/
*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/
.
*
/
#import "Base64.h"
@implementation
NSData
(
Base64
)
@implementation
Base64
#define ArrayLength(x) (sizeof(x)/sizeof(*(x)))
static
char
encodingTable
[]
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
;
static
char
decodingTable
[
128
];
+
(
void
)
initialize
{
if
(
self
==
[
Base64
class
])
{
memset
(
decodingTable
,
0
,
ArrayLength
(
decodingTable
));
for
(
NSInteger
i
=
0
;
i
<
ArrayLength
(
encodingTable
);
i
++
)
{
decodingTable
[
encodingTable
[
i
]]
=
i
;
}
}
}
+
(
NSString
*
)
encode
:
(
const
uint8_t
*
)
input
length
:
(
NSInteger
)
length
{
NSMutableData
*
data
=
[
NSMutableData
dataWithLength
:((
length
+
2
)
/
3
)
*
4
];
uint8_t
*
output
=
(
uint8_t
*
)
data
.
mutableBytes
;
for
(
NSInteger
i
=
0
;
i
<
length
;
i
+=
3
)
{
NSInteger
value
=
0
;
for
(
NSInteger
j
=
i
;
j
<
(
i
+
3
);
j
++
)
{
value
<<=
8
;
if
(
j
<
length
)
{
value
|=
(
0xFF
&
input
[
j
]);
}
}
NSInteger
index
=
(
i
/
3
)
*
4
;
output
[
index
+
0
]
=
encodingTable
[(
value
>>
18
)
&
0x3F
];
output
[
index
+
1
]
=
encodingTable
[(
value
>>
12
)
&
0x3F
];
output
[
index
+
2
]
=
(
i
+
1
)
<
length
?
encodingTable
[(
value
>>
6
)
&
0x3F
]
:
'='
;
output
[
index
+
3
]
=
(
i
+
2
)
<
length
?
encodingTable
[(
value
>>
0
)
&
0x3F
]
:
'='
;
}
return
[[
NSString
alloc
]
initWithData
:
data
encoding
:
NSASCIIStringEncoding
];
}
+
(
NSString
*
)
encode
:
(
NSData
*
)
rawBytes
{
return
[
self
encode
:(
const
uint8_t
*
)
rawBytes
.
bytes
length
:
rawBytes
.
length
];
}
+
(
NSData
*
)
decode
:
(
const
char
*
)
string
length
:
(
NSInteger
)
inputLength
{
if
((
string
==
NULL
)
||
(
inputLength
%
4
!=
0
))
{
+
(
id
)
dataWithBase64String
:(
NSString
*
)
base64Encoding
{
if
([
base64Encoding
length
]
%
4
!=
0
)
return
nil
;
}
while
(
inputLength
>
0
&&
string
[
inputLength
-
1
]
==
'='
)
{
inputLength
--
;
}
NSInteger
outputLength
=
inputLength
*
3
/
4
;
NSMutableData
*
data
=
[
NSMutableData
dataWithLength
:
outputLength
];
uint8_t
*
output
=
data
.
mutableBytes
;
NSInteger
inputPoint
=
0
;
NSInteger
outputPoint
=
0
;
while
(
inputPoint
<
inputLength
)
{
char
i0
=
string
[
inputPoint
++
];
char
i1
=
string
[
inputPoint
++
];
char
i2
=
inputPoint
<
inputLength
?
string
[
inputPoint
++
]
:
'A'
;
/* 'A' will decode to \0 */
char
i3
=
inputPoint
<
inputLength
?
string
[
inputPoint
++
]
:
'A'
;
output
[
outputPoint
++
]
=
(
decodingTable
[
i0
]
<<
2
)
|
(
decodingTable
[
i1
]
>>
4
);
if
(
outputPoint
<
outputLength
)
{
output
[
outputPoint
++
]
=
((
decodingTable
[
i1
]
&
0xf
)
<<
4
)
|
(
decodingTable
[
i2
]
>>
2
);
}
if
(
outputPoint
<
outputLength
)
{
output
[
outputPoint
++
]
=
((
decodingTable
[
i2
]
&
0x3
)
<<
6
)
|
decodingTable
[
i3
];
}
}
return
data
;
NSString
*
plist
=
[
NSString
stringWithFormat
:
@"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
?><plist version=
\"
1.0
\"
><data>%@</data></plist>"
,
base64Encoding
];
return
[
NSPropertyListSerialization
propertyListWithData
:[
plist
dataUsingEncoding
:
NSASCIIStringEncoding
]
options
:
0
format
:
NULL
error
:
NULL
];
}
+
(
NSData
*
)
decode
:
(
NSString
*
)
string
{
return
[
self
decode
:[
string
cStringUsingEncoding
:
NSASCIIStringEncoding
]
length
:
string
.
length
];
}
@end
ios/iosremote/iosremote/Communication/CommandInterpreter.m
Dosyayı görüntüle @
57058331
...
...
@@ -73,13 +73,11 @@
AtIndex
:
slideNumber
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
MSG_SLIDE_PREVIEW
object
:[
NSNumber
numberWithUnsignedInt
:
slideNumber
]];
}
else
if
([
instruction
isEqualToString
:
@"slide_notes"
]){
NSLog
(
@"Interpreter: slide_notes"
);
uint
slideNumber
=
[[
command
objectAtIndex
:
1
]
integerValue
];
NS
String
*
notes
;
NS
MutableString
*
notes
=
[[
NSMutableString
alloc
]
init
]
;
for
(
int
i
=
2
;
i
<
command
.
count
;
++
i
)
{
[
notes
stringByAppending
String
:[
command
objectAtIndex
:
i
]];
[
notes
append
String
:[
command
objectAtIndex
:
i
]];
}
[
self
.
slideShow
putNotes
:
notes
AtIndex
:
slideNumber
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
MSG_SLIDE_NOTES
object
:
[
NSNumber
numberWithUnsignedInt
:
slideNumber
]];
...
...
ios/iosremote/iosremote/Communication/CommandTransmitter.m
Dosyayı görüntüle @
57058331
...
...
@@ -62,11 +62,11 @@
*/
-
(
void
)
blankScreenWithColor
:
(
UIColor
*
)
color
{
CGColorRef
colorRef
=
color
.
CGColor
;
NSString
*
colorString
=
[
CIColor
colorWithCGColor
:
colorRef
].
stringRepresentation
;
//
CGColorRef colorRef = color.CGColor;
//
NSString *colorString = [CIColor colorWithCGColor:colorRef].stringRepresentation;
// Need new server-end interface, since this is a platform dependent representation
[
self
.
client
sendCommand
:[
NSString
stringWithFormat
:
@"presentation_blank_screen
\n
%@
\n\n
"
,
colorString
]];
//
[self.client sendCommand:[NSString stringWithFormat:@"presentation_blank_screen\n%@\n\n", colorString]];
}
-
(
void
)
resume
...
...
ios/iosremote/iosremote/Communication/CommunicationManager.h
Dosyayı görüntüle @
57058331
...
...
@@ -36,7 +36,18 @@
#define STATUS_CONNECTION_FAILED @"STATUS_CONNECTION_FAILED"
typedef
enum
ConnectionState
:
NSInteger
ConnectionState
;
enum
ConnectionState
:
NSInteger
{
DISCONNECTED
,
SEARCHING
,
CONNECTING
,
CONNECTED
};
@interface
CommunicationManager
:
NSObject
@property
ConnectionState
state
;
@end
ios/iosremote/iosremote/Communication/CommunicationManager.m
Dosyayı görüntüle @
57058331
...
...
@@ -8,12 +8,50 @@
#import "CommunicationManager.h"
#import "Client.h"
#import "Server.h"
#import "CommandTransmitter.h"
#import "CommandInterpreter.h"
@interface
CommunicationManager
()
@property
(
nonatomic
,
strong
)
Client
*
client
;
@end
// Singlton Pattern
@implementation
CommunicationManager
@synthesize
client
=
_client
;
@synthesize
state
=
_state
;
+
(
CommunicationManager
*
)
sharedComManager
{
static
CommunicationManager
*
sharedComManager
=
nil
;
static
dispatch_once_t
_singletonPredicate
;
dispatch_once
(
&
_singletonPredicate
,
^
{
sharedComManager
=
[[
super
allocWithZone
:
nil
]
init
];
});
return
sharedComManager
;
}
-
(
id
)
init
{
self
=
[
super
init
];
self
.
state
=
DISCONNECTED
;
return
self
;
}
+
(
id
)
allocWithZone
:
(
NSZone
*
)
zone
{
return
[
self
sharedComManager
];
}
@end
ios/iosremote/iosremote/Communication/SlideShow.h
Dosyayı görüntüle @
57058331
...
...
@@ -17,4 +17,7 @@
-
(
void
)
putImage
:
(
NSString
*
)
img
AtIndex
:
(
uint
)
index
;
-
(
void
)
putNotes
:
(
NSString
*
)
notes
AtIndex
:
(
uint
)
index
;
-
(
UIImage
*
)
getImageAtIndex
:
(
uint
)
index
;
-
(
NSString
*
)
getNotesAtIndex
:
(
uint
)
index
;
@end
ios/iosremote/iosremote/Communication/SlideShow.m
Dosyayı görüntüle @
57058331
...
...
@@ -24,21 +24,36 @@
-
(
SlideShow
*
)
init
{
self
=
[
super
init
];
self
.
imagesArray
=
[[
NSMutableArray
alloc
]
init
];
self
.
notesArray
=
[[
NSMutableArray
alloc
]
init
];
_size
=
0
;
_currentSlide
=
0
;
return
self
;
}
-
(
void
)
putImage
:
(
NSString
*
)
img
AtIndex
:
(
uint
)
index
{
[
Base64
initialize
];
NSData
*
data
=
[
Base64
decode
:
img
];
NSData
*
data
=
[
NSData
dataWithBase64String
:
img
];
UIImage
*
image
=
[
UIImage
imageWithData
:
data
];
[
self
.
imagesArray
insertObject
:
image
atIndex
:
index
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"IMAGE_READY"
object
:
nil
];
}
-
(
void
)
putNotes
:
(
NSString
*
)
notes
AtIndex
:
(
uint
)
index
{
[
self
.
notesArray
insertObject
:
notes
atIndex
:
index
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"NOTE_READY"
object
:
nil
];
}
-
(
UIImage
*
)
getImageAtIndex
:
(
uint
)
index
{
return
[
self
.
imagesArray
objectAtIndex
:
index
];
}
-
(
NSString
*
)
getNotesAtIndex
:
(
uint
)
index
{
return
[
self
.
notesArray
objectAtIndex
:
index
];
}
@end
ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard
Dosyayı görüntüle @
57058331
This diff is collapsed.
Click to expand it.
ios/iosremote/iosremote/libreoffice_sdremoteViewController.m
Dosyayı görüntüle @
57058331
...
...
@@ -10,6 +10,7 @@
#import "libreoffice_sdremoteViewController.h"
#import "Server.h"
#import "Client.h"
#import "slideShowViewController.h"
@interface
libreoffice_sdremoteViewController
()
...
...
@@ -39,11 +40,18 @@
self
.
slideShowPreviewStartObserver
=
[
self
.
center
addObserverForName
:
STATUS_CONNECTED_SLIDESHOW_RUNNING
object
:
nil
queue
:
mainQueue
usingBlock
:^
(
NSNotification
*
note
)
{
NSLog
(
@"Received performSegue!"
);
[
self
performSegueWithIdentifier
:
@"slidesPreview"
sender
:
self
];
[
self
performSegueWithIdentifier
:
@"slidesPreview
Segue
"
sender
:
self
];
}];
}
-
(
void
)
prepareForSegue
:
(
UIStoryboardSegue
*
)
segue
sender
:
(
id
)
sender
{
if
([
segue
.
identifier
isEqualToString
:
@"slidesPreviewSegue"
])
{
slideShowViewController
*
destViewController
=
segue
.
destinationViewController
;
destViewController
.
slideshow
=
[
self
.
interpreter
slideShow
];
}
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
...
...
ios/iosremote/iosremote/slideShowViewController.h
Dosyayı görüntüle @
57058331
...
...
@@ -7,9 +7,15 @@
//
#import <UIKit/UIKit.h>
#import "SlideShow.h"
@interface
slideShowViewController
:
UIViewController
@property
(
weak
,
nonatomic
)
IBOutlet
UIImageView
*
image
;
@property
(
weak
,
nonatomic
)
IBOutlet
UIWebView
*
lecturer_notes
;
@property
(
nonatomic
,
strong
)
SlideShow
*
slideshow
;
@property
(
nonatomic
,
strong
)
id
slideShowImageReadyObserver
;
@property
(
nonatomic
,
strong
)
id
slideShowNoteReadyObserver
;
@end
ios/iosremote/iosremote/slideShowViewController.m
Dosyayı görüntüle @
57058331
...
...
@@ -7,6 +7,7 @@
//
#import "slideShowViewController.h"
#import "SlideShow.h"
@interface
slideShowViewController
()
...
...
@@ -14,6 +15,10 @@
@implementation
slideShowViewController
@synthesize
slideshow
=
_slideshow
;
@synthesize
slideShowImageReadyObserver
=
_slideShowImageReadyObserver
;
@synthesize
slideShowNoteReadyObserver
=
_slideShowNoteReadyObserver
;
-
(
id
)
initWithNibName
:(
NSString
*
)
nibNameOrNil
bundle
:(
NSBundle
*
)
nibBundleOrNil
{
self
=
[
super
initWithNibName
:
nibNameOrNil
bundle
:
nibBundleOrNil
];
...
...
@@ -26,9 +31,23 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
NSNotificationCenter
*
center
=
[
NSNotificationCenter
defaultCenter
];
NSOperationQueue
*
mainQueue
=
[
NSOperationQueue
mainQueue
];
self
.
slideShowImageReadyObserver
=
[
center
addObserverForName
:
@"IMAGE_READY"
object
:
nil
queue
:
mainQueue
usingBlock
:^
(
NSNotification
*
note
)
{
NSLog
(
@"Getting image to display: %@"
,
[
self
.
slideshow
getImageAtIndex
:
0
]);
[
self
.
image
setImage
:[
self
.
slideshow
getImageAtIndex
:
0
]];
}];
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
];
}];
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
...
...
@@ -37,6 +56,7 @@
-
(
void
)
viewDidUnload
{
[
self
setImage
:
nil
];
[
self
setLecturer_notes
:
nil
];
[
super
viewDidUnload
];
}
@end
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