Skip to content

Commit 06deee4

Browse files
committed
Resolve merge conflict
2 parents 868250d + 07200b0 commit 06deee4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1559
-616
lines changed

.github/workflows/makefile.yml

+4-8
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
# Big thanks to @tomara-x and @timothyschoen for showing me how to do this! -ag
9898

9999
github-release:
100-
if: startsWith(github.ref, 'refs/tags/')
100+
if: github.ref_type == 'tag'
101101
runs-on: ubuntu-latest
102102
needs: [ubuntu-build, macos-build, windows-build]
103103

@@ -157,13 +157,11 @@ jobs:
157157
- name: check deken package
158158
shell: bash
159159
run: |
160-
SHORT=${GITHUB_REF:10}
161-
VERSION=${SHORT//\//_}
162160
echo "## ${{ matrix.os }}" | tee -a $GITHUB_STEP_SUMMARY
163161
mkdir -p package-${{ matrix.os }}
164162
docker run --rm --user $(id -u) --volume ./pdlua-${{ matrix.os }}:/pdlua \
165163
--volume ./package-${{ matrix.os }}:/package registry.git.iem.at/pd/deken \
166-
deken package --output-dir /package -v "${VERSION}" /pdlua
164+
deken package --output-dir /package -v "${{ github.ref_name }}" /pdlua
167165
168166
dek_files=$(ls package-${{ matrix.os }}/*.dek)
169167
for dek_file in $dek_files; do
@@ -204,13 +202,11 @@ jobs:
204202
DEKEN_USERNAME: ${{ secrets.DEKEN_USERNAME }}
205203
DEKEN_PASSWORD: ${{ secrets.DEKEN_PASSWORD }}
206204
run: |
207-
SHORT=${GITHUB_REF:10}
208-
VERSION=${SHORT//\//_}
209205
for os in ubuntu macos windows; do
210206
docker run --rm -e DEKEN_USERNAME -e DEKEN_PASSWORD \
211207
--volume ./pdlua-${os}:/pdlua registry.git.iem.at/pd/deken \
212-
deken upload --no-source-error -v "${VERSION}" /pdlua
208+
deken upload --no-source-error -v "${{ github.ref_name }}" /pdlua
213209
done
214210
docker run --rm -e DEKEN_USERNAME -e DEKEN_PASSWORD \
215211
--volume ./pdlua-src:/pdlua registry.git.iem.at/pd/deken \
216-
deken upload -v "${VERSION}" /pdlua
212+
deken upload -v "${{ github.ref_name }}" /pdlua

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@ pdx_files = $(addprefix ./pdlua/tutorial/examples/, pdx.lua pd-remote.el pd-remo
5656
installplus:
5757
$(INSTALL_DIR) -v "$(installpath)"
5858
cp -r ./pdlua/ "${installpath}"/pdlua
59+
cp pdlua-meta.pd "${installpath}"
5960
cp $(pdx_files) "${installpath}"

README

+22-10
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ corresponding subdirectories). Originally written by Claude Heiland-Allen,
2727
pdlua has gone through the hands of a few people over the years, including
2828
mrpeach (maintainer since 2011), zmoelnig a.k.a. umlaeute (loader update,
2929
Debian package), and myself (Arch package, Lua 5.3+ support, Purr Data and
30-
plugdata support, tutorial). Please also check my brief account on the history
31-
of pd-lua below.
30+
plugdata support, pdx.lua live-coding extension, tutorial). Please also check
31+
my brief account on the history of pd-lua below.
3232

3333
Lua 5.4 is highly recommended with the latest version, Lua 5.3 works as
3434
well. Reportedly, Lua 5.2 and even 5.1 still work (at least to some extent),
@@ -85,19 +85,16 @@ on https://github.com/agraef/pd-lua (but see below for the Deken package).
8585
Also, both Purr Data and plugdata ship with pdlua, and have it enabled by
8686
default, so no 3rd party package is needed in those environments.
8787

88-
For vanilla, we recommend installing the Deken package (named `pdlua`),
88+
For vanilla Pd, we recommend installing the Deken package (named `pdlua`),
8989
readily available using Pd's `Find externals` menu option. This package was
9090
originally uploaded by Alexandre Porres, but Ben Wesch recently added Deken
9191
tests and uploads to our GitHub workflow, so that the Deken releases are now
9292
automatized and always in sync with the GitHub releases. Thanks, Ben!
9393

94-
The latest release is also in the Arch repositories (maintained by dvzrv,
95-
thanks David!), and in the Debian repositories (maintained by IOhannes
96-
Zmölnig, thanks umlaeute!).
97-
98-
To enable the pdlua loader in Pd after installation, just add `pdlua` to your
99-
startup libraries (after adding its parent directory to Pd's search path if
100-
necessary) and you should be set.
94+
pd-lua is also in the Arch repositories (maintained by dvzrv, thanks David!),
95+
and in the Debian repositories (maintained by IOhannes Zmölnig, thanks
96+
umlaeute!). (During busy times, these may trail our releases for a little bit,
97+
but most of the time they will the latest version.)
10198

10299
Mac users please note that the packages I distribute aren't notarized, so on
103100
recent macOS versions you'll have to jump through the usual hoops to make them
@@ -106,6 +103,21 @@ usually do the trick, but check the internet for up-to-date information on
106103
Gatekeeper for details.
107104

108105

106+
Enabling pdlua:
107+
108+
Again, this step is only necessary with vanilla Pd; both Purr Data and
109+
plugdata have the pdlua loader enabled by default, so it should be ready to go
110+
immediately.
111+
112+
With vanilla Pd, after installing pdlua, the pdlua loader also needs to be
113+
added to your startup libraries, before Pd will recognize any Lua object in
114+
your patches. This only needs to be done once. (Alternatively, you can also
115+
use the `-lib pdlua` option on the Pd command line, or a `declare -lib pdlua`
116+
object in a patch with Lua objects.) To make any of this work, you may also
117+
have to add the parent directory of the `pdlua` folder to Pd's search path if
118+
pdlua was installed in an unusual location.
119+
120+
109121
Compilation Instructions:
110122

111123
You can also compile pdlua yourself from source, which isn't hard to do.

doc/graphics.txt

+41-34
Original file line numberDiff line numberDiff line change
@@ -28,47 +28,54 @@ end
2828

2929
API overview
3030
--------------
31-
-- Callback functions you can define
3231

33-
pd:Class:mouse_down(x, y) -- Mouse down callback, called when the mouse is clicked
34-
pd:Class:mouse_up(x, y) -- Mouse up callback, called when the mouse button is released
35-
pd:Class:mouse_move(x, y) -- Mouse move callback, called when the mouse is moved while not being down
36-
pd:Class:mouse_drag(x, y) -- Mouse drag callback, called when the mouse is moved while also being down
32+
-- Callback functions you can define
33+
pd:Class:mouse_down(x, y) -- Mouse down callback, called when the mouse is clicked
34+
pd:Class:mouse_up(x, y) -- Mouse up callback, called when the mouse button is released
35+
pd:Class:mouse_move(x, y) -- Mouse move callback, called when the mouse is moved while not being down
36+
pd:Class:mouse_drag(x, y) -- Mouse drag callback, called when the mouse is moved while also being down
3737

3838
-- Functions you can call
39-
pd:Class:repaint() -- Request a repaint, after this the "paint" callback will occur
40-
pd:Class:paint(g) -- Paint callback, returns a graphics_context object (commonly called g) that you can call these drawing functions on:
41-
g:set_size(w, h) -- Sets the size of the object.
42-
width, height = g:get_size(w, h) -- Gets the size of the object.
39+
pd:Class:repaint() -- Request a repaint, after this the "paint" callback will occur
40+
pd:Class:paint(g) -- Paint callback, returns a graphics_context object (commonly called g) that you can call these drawing functions on:
41+
42+
g:set_size(w, h) -- Sets the size of the object
43+
width, height = g:get_size(w, h) -- Gets the size of the object
4344

44-
g:set_color(r, g, b, a=1.0) -- Sets the color for the next drawing operation.
45+
g:set_color(r, g, b, a=1.0) -- Sets the color for the next drawing operation
4546

46-
g:fill_ellipse(x, y, w, h) -- Draws a filled ellipse at the specified position and size.
47-
g:stroke_ellipse(x, y, w, h, line_width) -- Draws the outline of an ellipse at the specified position and size.
47+
g:fill_ellipse(x, y, w, h) -- Draws a filled ellipse at the specified position and size
48+
g:stroke_ellipse(x, y, w, h, line_width) -- Draws the outline of an ellipse at the specified position and size
4849

49-
g:fill_rect(x, y, w, h) -- Draws a filled rectangle at the specified position and size.
50-
g:stroke_rect(x, y, w, h, line_width) -- Draws the outline of a rectangle at the specified position and size.
50+
g:fill_rect(x, y, w, h) -- Draws a filled rectangle at the specified position and size
51+
g:stroke_rect(x, y, w, h, line_width) -- Draws the outline of a rectangle at the specified position and size
5152

52-
g:fill_rounded_rect(x, y, w, h, corner_radius) -- Draws a filled rounded rectangle at the specified position and size.
53-
g:stroke_rounded_rect(x, y, w, h, corner_radius, line_width) -- Draws the outline of a rounded rectangle at the specified position and size.
53+
g:fill_rounded_rect(x, y, w, h, corner_radius) -- Draws a filled rounded rectangle at the specified position and size
54+
g:stroke_rounded_rect(x, y, w, h, corner_radius, line_width) -- Draws the outline of a rounded rectangle at the specified position and size
5455

55-
g:draw_line(x1, y1, x2, y2) -- Draws a line between two points.
56-
g:draw_text(text, x, y, w, fontsize) -- Draws text at the specified position and size.
56+
g:draw_line(x1, y1, x2, y2) -- Draws a line between two points
57+
g:draw_text(text, x, y, w, fontsize) -- Draws text at the specified position and size
5758

58-
g:fill_all() -- Fills the entire drawing area with the current color. Also will draw an object outline in the style of the host (ie. pure-data or plugdata)
59+
g:fill_all() -- Fills the entire drawing area with the current color. Also will draw an object outline in the style of the host (ie. pure-data or plugdata)
5960

60-
g:translate(tx, ty) -- Translates the coordinate system by the specified amounts.
61-
g:scale(sx, sy) -- Scales the coordinate system by the specified factors. This will always happen after the translation
62-
g:reset_transform() -- Resets current scale and translation
61+
g:translate(tx, ty) -- Translates the coordinate system by the specified amounts
62+
g:scale(sx, sy) -- Scales the coordinate system by the specified factors. This will always happen after the translation
63+
g:reset_transform() -- Resets current scale and translation
6364

64-
p = Path(x, y) -- Initiates a new path at the specified point
65-
p:line_to(x, y) -- Adds a line segment to the path.
66-
p:quad_to(x1, y1, x2, y2) -- Adds a quadratic Bezier curve to the path.
67-
p:cubic_to(x1, y1, x2, y2, x3, y) -- Adds a cubic Bezier curve to the path.
68-
p:close_path() -- Closes the path.
65+
p = Path(x, y) -- Initiates a new path at the specified point
66+
p:line_to(x, y) -- Adds a line segment to the path
67+
p:quad_to(x1, y1, x2, y2) -- Adds a quadratic Bezier curve to the path
68+
p:cubic_to(x1, y1, x2, y2, x3, y) -- Adds a cubic Bezier curve to the path
69+
p:close_path() -- Closes the path
70+
71+
g:stroke_path(p, line_width) -- Draws the outline of the path with the specified line width
72+
g:fill_path(p) -- Fills the current path
73+
74+
-- Additional functions
75+
expandedsymbol = pd:Class:canvas_realizedollar(s) -- Expand dollar symbols in patch canvas context
76+
pd:Class:set_args(args) -- Set the object arguments to be saved in the patch file
77+
pd:Class:get_args() -- Get the object arguments to be saved in the patch file
6978

70-
g:stroke_path(p, line_width) -- Draws the outline of the path with the specified line width.
71-
g:fill_path(p) -- Fills the current path.
7279

7380
Basic example
7481
---------------------
@@ -94,12 +101,12 @@ function example:mouse_drag(x, y)
94101
self:repaint()
95102
end
96103

97-
function example:paint()
104+
function example:paint(g)
98105
-- Fill background with color
99-
gfx.set_color(255, 0, 0, 1)
100-
gfx.fill_all()
106+
g:set_color(255, 0, 0, 1)
107+
g:fill_all()
101108

102109
-- Draw an ellipse
103-
gfx.set_color(0, 255, 0, 1)
104-
gfx.fill_ellipse(self.circle_x, self.circle_y, 30, 30)
110+
g:set_color(0, 255, 0, 1)
111+
g:fill_ellipse(self.circle_x, self.circle_y, 30, 30)
105112
end

0 commit comments

Comments
 (0)