Skip to content

Commit

Permalink
Merge pull request #49 from danielpetri1/tldraw-v2-squashed
Browse files Browse the repository at this point in the history
feat: Tldraw v2: presentation area video file
  • Loading branch information
kepstin authored Jun 10, 2024
2 parents ef37918 + 52c70e6 commit 09e9efe
Show file tree
Hide file tree
Showing 51 changed files with 4,196 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022 Calvin Walton
# SPDX-FileCopyrightText: 2024 Calvin Walton
#
# SPDX-License-Identifier: CC0-1.0

Expand Down
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Upstream-Contact: Calvin Walton <[email protected]>
Source: https://github.com/blindsidenetworks/bbb-presentation-video

Files: debian/*
Copyright: 2022 Calvin Walton
Copyright: 2024 Calvin Walton
License: MIT
2 changes: 1 addition & 1 deletion bbb_presentation_video/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022 BigBlueButton Inc. and by respective authors
# SPDX-FileCopyrightText: 2024 BigBlueButton Inc. and by respective authors
#
# SPDX-License-Identifier: GPL-3.0-or-later

Expand Down
4 changes: 2 additions & 2 deletions bbb_presentation_video/bindings/fontconfig.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022 BigBlueButton Inc. and by respective authors
# SPDX-FileCopyrightText: 2024 BigBlueButton Inc. and by respective authors
#
# SPDX-License-Identifier: GPL-3.0-or-later

Expand All @@ -15,7 +15,7 @@ class FontconfigError(Exception):


def _FcBool_errcheck(
result: Optional[Type[ctypes._CData]],
result: Optional[ctypes._CData],
_func: Any,
_arguments: Any,
) -> Any:
Expand Down
2 changes: 1 addition & 1 deletion bbb_presentation_video/events/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022 BigBlueButton Inc. and by respective authors
# SPDX-FileCopyrightText: 2024 BigBlueButton Inc. and by respective authors
#
# SPDX-License-Identifier: GPL-3.0-or-later

Expand Down
2 changes: 1 addition & 1 deletion bbb_presentation_video/events/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022 BigBlueButton Inc. and by respective authors
# SPDX-FileCopyrightText: 2024 BigBlueButton Inc. and by respective authors
#
# SPDX-License-Identifier: GPL-3.0-or-later

Expand Down
2 changes: 1 addition & 1 deletion bbb_presentation_video/events/helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022 BigBlueButton Inc. and by respective authors
# SPDX-FileCopyrightText: 2024 BigBlueButton Inc. and by respective authors
#
# SPDX-License-Identifier: GPL-3.0-or-later

Expand Down
48 changes: 43 additions & 5 deletions bbb_presentation_video/events/tldraw.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# SPDX-FileCopyrightText: 2022 BigBlueButton Inc. and by respective authors
# SPDX-FileCopyrightText: 2024 BigBlueButton Inc. and by respective authors
#
# SPDX-License-Identifier: GPL-3.0-or-later

import json
from typing import Dict, List, Optional, TypedDict
from typing import Any, Collection, Dict, List, Optional, Sequence, TypedDict, Union

from lxml import etree

Expand All @@ -13,19 +13,47 @@
class StyleData(TypedDict, total=False):
color: str
dash: str
fill: str
font: str
isClosed: bool
isComplete: bool
isFilled: bool
opacity: float
scale: float
segments: List[Dict[str, Sequence[Collection[str]]]]
size: str
textAlign: str


class HandleData(TypedDict, total=False):
bindingId: str
canBind: bool
canSnap: bool
id: str
index: float
index: Union[float, str]
point: List[float]
canBind: bool
bindingId: str
type: str
x: float
y: float


class PropsData(StyleData, total=False):
align: str
arrowheadEnd: str
arrowheadStart: str
bend: float
end: HandleData
geo: str
growY: float
h: float
handles: Dict[str, HandleData]
isPen: bool
name: str
spline: str
start: HandleData
text: str
verticalAlign: str
w: float


class ShapeData(TypedDict, total=False):
Expand All @@ -34,20 +62,30 @@ class ShapeData(TypedDict, total=False):
decorations: Dict[str, Optional[str]]
handles: Dict[str, HandleData]
id: str
index: Union[float, str]
isComplete: bool
isLocked: bool
isModerator: bool
label: str
labelPoint: List[float]
meta: Dict[str, str]
name: str
opacity: float
parentId: str
point: List[float]
points: List[List[float]]
props: PropsData
radius: List[float]
rotation: float
size: List[float]
style: StyleData
text: str
type: str
typeName: str
userId: str
x: float
y: float
children: List[Any]


class AddShapeEvent(TypedDict):
Expand Down
6 changes: 4 additions & 2 deletions bbb_presentation_video/renderer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022 BigBlueButton Inc. and by respective authors
# SPDX-FileCopyrightText: 2024 BigBlueButton Inc. and by respective authors
#
# SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -213,7 +213,9 @@ def render(self) -> None:
bbb_version=self.events.bbb_version,
)
shapes = ShapesRenderer(self.ctx, presentation.transform)
tldraw = TldrawRenderer(self.ctx, presentation.transform)
tldraw = TldrawRenderer(
self.ctx, presentation.transform, self.events.bbb_version
)

encoder = Encoder(
self.output, self.width, self.height, self.framerate, self.codec
Expand Down
2 changes: 1 addition & 1 deletion bbb_presentation_video/renderer/cursor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022 BigBlueButton Inc. and by respective authors
# SPDX-FileCopyrightText: 2024 BigBlueButton Inc. and by respective authors
#
# SPDX-License-Identifier: GPL-3.0-or-later

Expand Down
10 changes: 6 additions & 4 deletions bbb_presentation_video/renderer/presentation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022 BigBlueButton Inc. and by respective authors
# SPDX-FileCopyrightText: 2024 BigBlueButton Inc. and by respective authors
#
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations
Expand Down Expand Up @@ -167,9 +167,11 @@ def __init__(
size=self.size,
pos=Position(-0.0, -0.0),
shapes_scale=1.0,
shapes_size=self.tldraw_drawing_size
if self.tldraw_whiteboard
else Size(DRAWING_SIZE, DRAWING_SIZE),
shapes_size=(
self.tldraw_drawing_size
if self.tldraw_whiteboard
else Size(DRAWING_SIZE, DRAWING_SIZE)
),
)

@property
Expand Down
Loading

0 comments on commit 09e9efe

Please sign in to comment.