Skip to content

Commit bf84973

Browse files
committed
Upgrade to Keynote 11.2. Closes #33.
1 parent 80d2e51 commit bf84973

35 files changed

+2914
-2469
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
`keynote-parser` is a Python module for unpacking and re-packing
66
[Apple Keynote](https://www.apple.com/keynote/) `.key` files. It supports Keynote
7-
files generated by Keynote version 10.2 (current as of October 2020).
7+
files generated by Keynote version 11.2 (current as of March 2022).
88

99
Keynote uses a proprietary, compressed binary format to store its presentations.
1010
This format is comprised of a zip file containing images and videos, as well as
@@ -117,7 +117,7 @@ A copy of O'Brien's format documentation is included in the `docs` folder for po
117117
All code in this repository is licensed under the MIT License.
118118

119119
```
120-
Copyright 2019-2020 Peter Sobot
120+
Copyright 2019-2022 Peter Sobot
121121
122122
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
123123
and associated documentation files (the "Software"), to deal in the Software without restriction,

keynote_parser/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
__major_version__ = 1
88
__patch_version__ = 1
99
__supported_keynote_version__ = keynote_parser.macos_app_version.MacOSAppVersion(
10-
"10.2", "7028.0.88", "1A122"
10+
"11.2", "7032.0.145", "12E262"
1111
)
1212
__version_tuple__ = (
1313
__major_version__,

keynote_parser/mapping.py

Lines changed: 611 additions & 583 deletions
Large diffs are not rendered by default.

protos/KNArchives.proto

Lines changed: 84 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ message PlaceholderArchive {
196196
kKindObjectPlaceholder = 4;
197197
}
198198
required .TSWP.ShapeInfoArchive super = 1;
199-
optional .KN.PlaceholderArchive.Kind kind = 2;
199+
optional .KN.PlaceholderArchive.Kind kind = 2 [default = kKindPlaceholder];
200200
}
201201

202202
message NoteArchive {
@@ -211,7 +211,7 @@ message ClassicStylesheetRecordArchive {
211211
message ClassicThemeRecordArchive {
212212
optional string uuid = 1;
213213
optional .TSP.Reference stylesheetRecord = 2;
214-
repeated .TSP.Reference masters = 3;
214+
repeated .TSP.Reference templates = 3;
215215
}
216216

217217
message SlideArchive {
@@ -257,8 +257,8 @@ message SlideArchive {
257257
repeated .TSP.Reference bodyListStyles = 35;
258258
optional string thumbnailTextForTitlePlaceholder = 37;
259259
optional string thumbnailTextForBodyPlaceholder = 38;
260-
optional bool slideObjectsLayerWithMaster = 41;
261-
optional .TSP.Reference master = 17;
260+
optional bool slide_objects_layer_with_template = 41 [default = false];
261+
optional .TSP.Reference template_slide = 17;
262262
repeated .TSD.GuideArchive staticGuides = 18;
263263
optional .TSP.Reference userDefinedGuideStorage = 36;
264264
required bool inDocument = 19;
@@ -288,7 +288,7 @@ message SlideNodeArchive {
288288
required bool hasBuilds = 6 [deprecated = true];
289289
required bool hasTransition = 7;
290290
optional bool hasNote = 8;
291-
optional bool isSlideNumberVisible = 18;
291+
optional bool isSlideNumberVisible = 18 [default = false];
292292
optional string uniqueIdentifier = 11 [deprecated = true];
293293
optional string copyFromSlideIdentifier = 12;
294294
optional uint32 slideSpecificHyperlinkCount = 13 [deprecated = true];
@@ -300,6 +300,8 @@ message SlideNodeArchive {
300300
optional bool has_explicit_builds_is_up_to_date = 23 [deprecated = true];
301301
repeated .KN.SlideNodeArchive.SlideSpecificHyperlinkMapEntry slideSpecificHyperlinkMap = 24;
302302
optional bool has_background_alpha = 28;
303+
optional .TSP.UUID template_slide_id = 29;
304+
repeated .TSP.UUID live_video_source_ids = 30;
303305
optional .TSP.Reference database_thumbnail = 3 [deprecated = true];
304306
repeated .TSP.Reference database_thumbnails = 9 [deprecated = true];
305307
}
@@ -319,15 +321,15 @@ message DesktopUILayoutArchive {
319321
optional bool notes_visible = 3;
320322
optional bool light_table_visible = 5;
321323
optional bool inspector_pane_visible = 6 [default = true];
322-
optional .KN.DesktopUILayoutArchive.InspectorPaneViewMode inspector_pane_view_mode = 7;
323-
optional bool showing_master_slides = 8;
324+
optional .KN.DesktopUILayoutArchive.InspectorPaneViewMode inspector_pane_view_mode = 7 [default = kInspectorPaneViewModeFormat];
325+
optional bool showing_template_slides = 8;
324326
optional bool inspector_pane_autohidden = 9;
325327
optional bool element_list_visible = 10;
326328
}
327329

328330
message UIStateArchive {
329331
optional .TSP.Reference slideNodeToEdit = 1 [deprecated = true];
330-
optional .TSP.Reference deprecated_masterSlideNodeToApply = 2;
332+
optional .TSP.Reference deprecated_template_slide_node_to_apply = 2;
331333
optional .TSP.Size deprecated_slideThumbnailSize = 3;
332334
optional float canvasViewScale = 4;
333335
optional .TSP.Point canvasOffset = 5;
@@ -343,7 +345,7 @@ message UIStateArchive {
343345
optional float light_table_zoom_scale = 14;
344346
repeated .TSCH.ChartUIState chart_ui_state = 15;
345347
optional bool show_slide_guides = 16;
346-
optional bool show_master_guides = 17;
348+
optional bool show_template_guides = 17;
347349
optional bool shows_comments = 18;
348350
optional bool comments_printing_toggle_enabled = 39;
349351
repeated .TSP.Reference collapsed_slide_nodes = 19;
@@ -390,6 +392,7 @@ message IOSSavedPlaybackStateArchive {
390392
optional double elapsed_time_start_time = 7;
391393
optional double recording_playback_current_time = 8;
392394
optional bool should_show_slide_navigator = 9;
395+
optional bool is_multi_presenter_show = 10;
393396
}
394397

395398
message CanvasSelectionArchive {
@@ -411,13 +414,14 @@ message ThemeCustomTimingCurveArchive {
411414

412415
message ThemeArchive {
413416
required .TSS.ThemeArchive super = 1;
414-
repeated .TSP.Reference masters = 2;
417+
repeated .TSP.Reference templates = 2;
415418
optional string uuid = 3;
416419
repeated .TSP.Reference classicThemeRecords = 4;
417-
optional .TSP.Reference defaultMasterSlideNode = 5;
418-
optional .TSP.Reference default_master_slide_node_reference = 6;
419-
optional bool default_master_slide_node_is_our_best_guess = 7;
420+
optional .TSP.Reference default_template_slide_node = 5;
421+
optional .TSP.Reference default_template_slide_node_reference = 6;
422+
optional bool default_template_slide_node_is_our_best_guess = 7;
420423
repeated .KN.ThemeCustomTimingCurveArchive custom_effect_timing_curves = 8;
424+
optional .TSP.Reference live_video_source_collection = 9;
421425
}
422426

423427
message SlideTreeArchive {
@@ -439,11 +443,11 @@ message ShowArchive {
439443
optional bool slideNumbersVisible = 6;
440444
optional .TSP.Reference recording = 7;
441445
optional bool loop_presentation = 8;
442-
optional .KN.ShowArchive.KNShowMode mode = 9;
443-
optional double autoplay_transition_delay = 10 [default = 5.0];
444-
optional double autoplay_build_delay = 11 [default = 2.0];
446+
optional .KN.ShowArchive.KNShowMode mode = 9 [default = kKNShowModeNormal];
447+
optional double autoplay_transition_delay = 10 [default = 5];
448+
optional double autoplay_build_delay = 11 [default = 2];
445449
optional bool idle_timer_active = 15;
446-
optional double idle_timer_delay = 16 [default = 900.0];
450+
optional double idle_timer_delay = 16 [default = 900];
447451
optional .TSP.Reference soundtrack = 17;
448452
optional bool automatically_plays_upon_open = 18;
449453
optional .TSP.Reference slideList = 19;
@@ -467,17 +471,21 @@ message SlideStylePropertiesArchive {
467471

468472
message SlideStyleArchive {
469473
required .TSS.StyleArchive super = 1;
470-
optional uint32 override_count = 10;
474+
optional uint32 override_count = 10 [default = 0];
471475
optional .KN.SlideStylePropertiesArchive slide_properties = 11;
472476
}
473477

474478
message PasteboardNativeStorageArchive {
479+
message LiveVideoSourcePair {
480+
optional .TSP.Reference live_video_info = 1;
481+
optional .TSP.Reference live_video_source = 2;
482+
}
475483
repeated .TSP.Reference drawables = 1;
476484
repeated .TSP.Reference builds = 2;
477485
repeated .TSP.Reference buildChunks = 3;
478486
repeated .TSP.Reference slideNodes = 4;
479487
repeated .TSP.Reference displayed_slide_nodes = 12;
480-
repeated .TSP.Reference masterSlideNodes = 9;
488+
repeated .TSP.Reference template_slide_nodes = 9;
481489
repeated .TSP.Reference collapsedSlideNodes = 10;
482490
repeated .TSP.Reference outlineCollapsedSlideNodes = 11;
483491
repeated .TSP.Reference outlineHasBodySlideNodes = 13;
@@ -489,11 +497,12 @@ message PasteboardNativeStorageArchive {
489497
repeated string original_slide_node_UUIDs = 15;
490498
optional bool slide_nodes_have_datas_needing_download = 16;
491499
optional .KN.TransitionArchive transition = 17;
500+
repeated .KN.PasteboardNativeStorageArchive.LiveVideoSourcePair live_video_sources = 18;
492501
}
493502

494-
message PrototypeForUndoMasterChangeArchive {
503+
message PrototypeForUndoTemplateChangeArchive {
495504
optional .TSP.Reference slide_style = 1;
496-
required .TSP.UUID master_slide_id = 2;
505+
required .TSP.UUID template_slide_id = 2;
497506
repeated .TSP.UUID drawable_info_id_list = 3;
498507
repeated .TSP.Reference placeholders = 4;
499508
repeated string placeholder_tags_list = 5;
@@ -507,15 +516,15 @@ message RecordingArchive {
507516
repeated .TSP.Reference event_tracks = 1;
508517
optional .TSP.Reference movie_track = 2;
509518
optional double duration = 3;
510-
optional .KN.RecordingArchive.RecordingSyncStateEnum sync_state_enum = 4 [deprecated = true];
519+
optional .KN.RecordingArchive.RecordingSyncStateEnum sync_state_enum = 4 [default = kRecordingSyncStateInSyncWithShow, deprecated = true];
511520
optional .TSP.Date modification_date = 5;
512521
optional .KN.RecordingSyncState sync_state = 6;
513522
optional .KN.RecordingCorrectionHistory correction_history = 7;
514523
}
515524

516525
message RecordingSyncState {
517526
optional .TSP.UUID out_of_sync_token = 1;
518-
optional bool can_clear_out_of_sync_token = 2;
527+
optional bool can_clear_out_of_sync_token = 2 [default = false];
519528
}
520529

521530
message RecordingCorrectionHistory {
@@ -528,7 +537,7 @@ message RecordingEventTrackArchive {
528537
}
529538

530539
message RecordingEventArchive {
531-
optional double start_time = 1 [default = -1.0];
540+
optional double start_time = 1 [default = -1];
532541
optional .KN.RecordingNavigationEventArchive navigation_event_archive = 1000;
533542
optional .KN.RecordingLaserEventArchive laser_event_archive = 1001;
534543
optional .KN.RecordingPauseEventArchive pause_event_archive = 1002;
@@ -544,7 +553,7 @@ message RecordingNavigationEventArchive {
544553
optional .TSP.UUID target_slide_node_id = 4;
545554
optional .TSP.Reference target_slide_node_reference = 1;
546555
optional uint32 target_event_index = 2;
547-
optional .KN.RecordingNavigationEventArchive.RecordingNavigationEventAnimationPhase animation_phase = 3;
556+
optional .KN.RecordingNavigationEventArchive.RecordingNavigationEventAnimationPhase animation_phase = 3 [default = kRecordingNavigationEventAnimationNone];
548557
}
549558

550559
message RecordingLaserEventArchive {
@@ -559,7 +568,7 @@ message RecordingPauseEventArchive {
559568
kRecordingPauseEventTypeConcealWithBlack = 2;
560569
kRecordingPauseEventTypeConcealWithWhite = 3;
561570
}
562-
optional .KN.RecordingPauseEventArchive.RecordingPauseEventType pause_event_type = 1;
571+
optional .KN.RecordingPauseEventArchive.RecordingPauseEventType pause_event_type = 1 [default = kRecordingPauseEventTypeResume];
563572
}
564573

565574
message RecordingMovieEventArchive {
@@ -586,7 +595,7 @@ message RecordingMovieTrackArchive {
586595

587596
message MovieSegmentArchive {
588597
optional .TSP.DataReference movie_data = 3;
589-
optional double start_time = 2 [default = -1.0];
598+
optional double start_time = 2 [default = -1];
590599
optional .TSP.Reference database_movie_data = 1;
591600
}
592601

@@ -597,7 +606,7 @@ message Soundtrack {
597606
kKNSoundtrackModeDoNotPlay = 2;
598607
}
599608
optional double volume = 1;
600-
optional .KN.Soundtrack.SoundtrackMode mode = 2;
609+
optional .KN.Soundtrack.SoundtrackMode mode = 2 [default = kKNSoundtrackModePlayOnce];
601610
repeated .TSP.DataReference movie_media = 3;
602611
}
603612

@@ -634,4 +643,51 @@ message MixedIdOperationArgs {
634643
repeated .TSK.IdPlacementOperationArgs hide_placeholder_args_list = 5;
635644
}
636645

646+
message LiveVideoInfo {
647+
optional .TSP.UUID source_id = 1;
648+
optional bool is_placeholder = 2;
649+
optional double scale = 3;
650+
optional .TSP.Point normalized_offset = 4;
651+
optional int32 mask_kind = 5;
652+
optional double mask_corner_radius = 6;
653+
extend .TSD.MovieArchive {
654+
optional .KN.LiveVideoInfo live_video_info = 100;
655+
}
656+
}
657+
658+
message LiveVideoSource {
659+
optional string name = 1;
660+
optional .KN.LiveVideoCaptureDeviceDescription capture_device_description = 2;
661+
optional .KN.LiveVideoSourceCollaborationCommandUsageState collaboration_command_usage_state = 3;
662+
optional .TSP.DataReference poster_image_data = 4;
663+
optional string symbol_abbreviation_text = 5;
664+
optional int32 symbol_image_identifier = 6;
665+
optional int32 symbol_tint_color_identifier = 7;
666+
optional bool is_default_source = 8;
667+
}
668+
669+
message LiveVideoSourceCollaborationCommandUsageState {
670+
optional .TSP.UUID single_collaboration_command_usage_token = 1;
671+
optional bool has_multiple_collaboration_command_usage_tokens = 2;
672+
}
673+
674+
message LiveVideoCaptureDeviceDescription {
675+
enum Position {
676+
Unspecified = 0;
677+
Back = 1;
678+
Front = 2;
679+
}
680+
optional string unique_id = 1;
681+
optional .KN.LiveVideoCaptureDeviceDescription.Position position = 2;
682+
optional string device_type = 3;
683+
optional string localized_name = 4;
684+
optional bool is_ios_screen_recording_device = 5;
685+
optional string model_id = 6;
686+
optional .TSP.Size default_video_resolution = 7;
687+
}
688+
689+
message LiveVideoSourceCollection {
690+
repeated .TSP.Reference sources = 1;
691+
optional .TSP.Reference default_source = 2;
692+
}
637693

protos/KNArchives_sos.proto

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,21 @@ syntax = "proto2";
22

33
import "KNArchives.proto";
44
import "TSDArchives_sos.proto";
5-
package KN;
5+
package KNSOS;
66

77
message SpecSetTransitionAttributesArchive {
88
optional .KN.TransitionAttributesArchive transition_attributes = 1;
99
required bool unset = 2;
1010
}
1111

1212
message SpecTransitionAttributesArchive {
13-
optional .KN.SpecSetTransitionAttributesArchive spec_set_transition_attributes = 1;
13+
optional .KNSOS.SpecSetTransitionAttributesArchive spec_set_transition_attributes = 1;
1414
}
1515

1616
message SlideStylePropertyChangeSetArchive {
17-
optional .TSD.SpecFillArchive fill = 1;
17+
optional .TSDSOS.SpecFillArchive fill = 1;
1818
optional bool fill_undefined = 2;
19-
optional .KN.SpecTransitionAttributesArchive slide_transition = 3;
19+
optional .KNSOS.SpecTransitionAttributesArchive slide_transition = 3;
2020
optional bool slide_transition_undefined = 4;
2121
}
2222

23-

0 commit comments

Comments
 (0)