Skip to content

Commit 5ee1fd7

Browse files
committed
add Pd's color to comment
1 parent ffa78c5 commit 5ee1fd7

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

.github/workflows/c-cpp.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ jobs:
1818

1919
- name: Downloads pd-Sources
2020
run: |
21-
PD_URL=$(curl -L -s https://api.github.com/repos/pure-data/pure-data/tags | grep zipball_url | grep -v latest | grep -v pd-0.55 | grep -v tagtest | head -n 1 | cut -d '"' -f 4)
22-
curl -L -o pure-data.zip $PD_URL
21+
curl -L -o pure-data.zip https://api.github.com/repos/pure-data/pure-data/zipball/refs/tags/0.56-0test1
2322
unzip pure-data.zip
2423
rm pure-data.zip
2524
mv pure-data-* pure-data
@@ -57,7 +56,7 @@ jobs:
5756
make
5857
WORKDIR /build
5958
COPY . .
60-
RUN PD_URL=$(curl -L -s https://api.github.com/repos/pure-data/pure-data/tags | grep zipball_url | grep -v latest | grep -v pd-0.55 | grep -v tagtest | head -n 1 | cut -d '"' -f 4) && \
59+
RUN PD_URL=$(curl -L -s https://api.github.com/repos/pure-data/pure-data/tags | grep zipball_url | grep -v latest | grep -v pd-0.56 | grep -v tagtest | head -n 1 | cut -d '"' -f 4) && \
6160
curl -L -o pure-data.zip $PD_URL && \
6261
unzip pure-data.zip && \
6362
rm pure-data.zip && \
@@ -100,10 +99,10 @@ jobs:
10099
- name: Get Pd
101100
shell: msys2 {0}
102101
run: |
103-
curl -L -o pure-data.zip http://msp.ucsd.edu/Software/pd-0.55-2.msw.zip
102+
curl -L -o pure-data.zip http://msp.ucsd.edu/Software/pd-0.56-0test1.msw.zip
104103
unzip pure-data.zip
105104
rm pure-data.zip
106-
rename pd-0.55-2 pure-data pd-0.55-2
105+
rename pd-0.56-0test1 pure-data pd-0.56-0test1
107106
108107
- name: Build pd-cyclone
109108
shell: msys2 {0}

cyclone_objects/binaries/control/comment.c

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ static void comment_draw_outline(t_comment *x){
162162
(unsigned long)x, // %lx_outline
163163
(unsigned long)x, // all%lx
164164
x->x_zoom,
165-
x->x_select ? "blue" : "black");
165+
x->x_select ?
166+
THISGUI->i_selectcolor->s_name :
167+
THISGUI->i_foregroundcolor->s_name);
166168
}
167169
}
168170

@@ -175,7 +177,7 @@ static void comment_draw_handle(t_comment *x){
175177
if(x->x_resized)
176178
x2 = x1 + x->x_max_pixwidth * x->x_zoom;
177179
sys_vgui("canvas %s -width %d -height %d -bg %s -cursor sb_h_double_arrow\n",
178-
ch->h_pathname, COMMENT_HANDLE_WIDTH, x->x_height, "black");
180+
ch->h_pathname, COMMENT_HANDLE_WIDTH, x->x_height, THISGUI->i_selectcolor->s_name);
179181
sys_vgui("bind %s <Button> {pdsend [concat %s _click 1 \\;]}\n", ch->h_pathname, ch->h_bindsym->s_name);
180182
sys_vgui("bind %s <ButtonRelease> {pdsend [concat %s _click 0 \\;]}\n", ch->h_pathname, ch->h_bindsym->s_name);
181183
sys_vgui("bind %s <Motion> {pdsend [concat %s _motion %%x %%y \\;]}\n", ch->h_pathname, ch->h_bindsym->s_name);
@@ -196,9 +198,11 @@ static void comment_draw_inlet(t_comment *x){
196198
if(x->x_edit && x->x_receive == &s_){
197199
t_canvas *cv = glist_getcanvas(x->x_glist);
198200
int xpos = text_xpix(&x->x_obj, x->x_glist), ypos = text_ypix(&x->x_obj, x->x_glist);
199-
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill black -tags [list %lx_in all%lx]\n",
200-
cv, xpos, ypos, xpos+(IOWIDTH*x->x_zoom), ypos+(IHEIGHT*x->x_zoom)-x->x_zoom,
201-
(unsigned long)x, (unsigned long)x);
201+
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill %s -tags [list %lx_in all%lx]\n",
202+
cv, xpos, ypos, xpos+(IOWIDTH*x->x_zoom),
203+
ypos+(IHEIGHT*x->x_zoom)-x->x_zoom,
204+
THISGUI->i_foregroundcolor->s_name,
205+
(unsigned long)x, (unsigned long)x);
202206
}
203207
}
204208
}
@@ -234,7 +238,7 @@ static void comment_draw(t_comment *x){
234238
y2 + 2*x->x_zoom,
235239
(unsigned long)x,
236240
(unsigned long)x,
237-
x->x_outline ? "black" : x->x_bgcolor,
241+
x->x_outline ? THISGUI->i_foregroundcolor->s_name : x->x_bgcolor,
238242
x->x_bgcolor);
239243
}
240244
char buf[COMMENT_OUTBUFSIZE], *outbuf, *outp;
@@ -249,7 +253,7 @@ static void comment_draw(t_comment *x){
249253
text_ypix((t_text *)x, x->x_glist) + x->x_zoom, // %d
250254
x->x_fontname->s_name, // {%s}
251255
x->x_fontsize * x->x_zoom, // -%d
252-
x->x_select ? "blue" : x->x_color, // %s
256+
x->x_select ? THISGUI->i_selectcolor->s_name : x->x_color, // %s
253257
x->x_bufsize, // %.
254258
x->x_buf, // *s
255259
x->x_max_pixwidth * x->x_zoom, // %d
@@ -393,9 +397,10 @@ static void comment_select(t_gobj *z, t_glist *glist, int state){
393397
x->x_select = state;
394398
if(!state && x->x_active)
395399
comment_activate(z, glist, 0);
396-
sys_vgui(".x%lx.c itemconfigure txt%lx -fill %s\n", x->x_cv, (unsigned long)x, state ? "blue" : x->x_color);
400+
sys_vgui(".x%lx.c itemconfigure txt%lx -fill %s\n", x->x_cv, (unsigned long)x, state ? THISGUI->i_selectcolor->s_name : x->x_color);
397401
sys_vgui(".x%lx.c itemconfigure %lx_outline -width %d -outline %s\n",
398-
x->x_cv, (unsigned long)x, x->x_zoom, state ? "blue" : "black");
402+
x->x_cv, (unsigned long)x, x->x_zoom,
403+
state ? THISGUI->i_selectcolor->s_name : THISGUI->i_foregroundcolor->s_name);
399404
// A regular rtext should set 'canvas_editing' variable to its canvas, we don't do it coz
400405
// we get keys via global binding to "#key" (and coz 'canvas_editing' isn't exported).
401406
}
@@ -471,8 +476,6 @@ static void comment__click_callback(t_comment *x, t_symbol *s, int ac, t_atom *a
471476
}
472477
}
473478
else if(xx > x->x_x2 - COMMENT_HANDLE_WIDTH){ // start resizing
474-
sprintf(outp, ".x%lx.c bind txt%lx <ButtonRelease> {pdsend {%s _release %s}}\n",
475-
cv, (unsigned long)x, x->x_bindsym->s_name, x->x_bindsym->s_name);
476479
outp += strlen(outp);
477480
sprintf(outp, ".x%lx.c bind txt%lx <Motion> {pdsend {%s _motion %s %%x %%y}}\n",
478481
cv, (unsigned long)x, x->x_bindsym->s_name, x->x_bindsym->s_name);
@@ -906,7 +909,7 @@ static void comment_bgcolor(t_comment *x, t_float r, t_float g, t_float b){
906909
sys_vgui(".x%lx.c itemconfigure bg%lx -outline %s -fill %s\n",
907910
x->x_cv,
908911
(unsigned long)x,
909-
x->x_outline ? "black" : x->x_bgcolor,
912+
x->x_outline ? THISGUI->i_foregroundcolor->s_name : x->x_bgcolor,
910913
x->x_bgcolor);
911914
}
912915
}
@@ -990,7 +993,7 @@ static void comment_outline(t_comment *x, t_floatarg outline){
990993
if(x->x_outline || x->x_edit){
991994
comment_draw_outline(x);
992995
if(x->x_bg_flag)
993-
sys_vgui(".x%lx.c itemconfigure bg%lx -outline black\n", x->x_cv, (unsigned long)x);
996+
sys_vgui(".x%lx.c itemconfigure bg%lx -outline %s\n", x->x_cv, (unsigned long)x, THISGUI->i_foregroundcolor->s_name);
994997
}
995998
else{
996999
sys_vgui(".x%lx.c delete %lx_outline\n", (unsigned long)x->x_cv, (unsigned long)x);

0 commit comments

Comments
 (0)