Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
purr-data
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aayush
purr-data
Commits
aed90478
Commit
aed90478
authored
Aug 21, 2019
by
Aayush
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bugs in ascii_art->pd
parent
f54a1cc5
Pipeline
#1649
failed with stage
in 0 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
27 deletions
+34
-27
pd/nw/pd_ascii_art.js
pd/nw/pd_ascii_art.js
+7
-4
pd/nw/pd_canvas.js
pd/nw/pd_canvas.js
+2
-0
pd/nw/pdgui.js
pd/nw/pdgui.js
+16
-15
pd/src/g_editor.c
pd/src/g_editor.c
+9
-0
pd/src/m_glob.c
pd/src/m_glob.c
+0
-8
No files found.
pd/nw/pd_ascii_art.js
View file @
aed90478
...
...
@@ -10,11 +10,14 @@ function INDEX(x, y){
function
tracking_connection
(
curr_row
,
curr_col
,
next_row
,
next_col
,
string_array
,
visited_array
)
{
var
next_character
,
curr_character
,
end_index
;
if
(
next_row
>=
string_array
.
length
||
next_col
>
string_array
[
next_row
].
length
)
{
end_index
=
new
INDEX
(
next_row
,
next_col
);
}
else
if
(
visited_array
[
next_row
][
next_col
]
==
0
)
{
curr_character
=
string_array
[
curr_row
][
curr_col
];
next_character
=
string_array
[
next_row
][
next_col
];
if
(
visited_array
[
next_row
][
next_col
]
==
0
)
{
visited_array
[
next_row
][
next_col
]
=
1
;
switch
(
next_character
)
{
...
...
pd/nw/pd_canvas.js
View file @
aed90478
...
...
@@ -1615,10 +1615,12 @@ function nw_create_patch_window_menus(gui, w, name) {
ascii_art_text_area
.
focus
();
ascii_art_text_area
.
select
();
canvas_events
.
ascii_art
();
//pdgui.pdsend(name,"ascii-entry",1);
}
else
{
ascii_art_text_area
.
value
=
"
write your ascii art here
"
;
ascii_art
.
style
.
setProperty
(
"
display
"
,
"
none
"
);
canvas_events
[
canvas_events
.
get_previous_state
()]();
//pdgui.pdsend(name,"ascii-entry",0);
}
}
});
...
...
pd/nw/pdgui.js
View file @
aed90478
...
...
@@ -1167,13 +1167,12 @@ function menu_quit() {
exports
.
menu_quit
=
menu_quit
;
function
ascii_entry
_callback
(
textarea_state
)
function
ascii_entry
(
cid
,
textarea_state
)
{
gui
(
cid
).
get_elem
(
"
ascii_art
"
,
function
(
w
)
{
var
ascii_art
=
w
.
document
.
getElementById
(
"
ascii_art
"
),
ascii_art_text_area
=
w
.
document
.
getElementById
(
"
ascii_art_text_area
"
);
if
(
textarea_state
==
1
)
{
alert
(
"
hi
"
);
ascii_art
.
style
.
setProperty
(
"
display
"
,
"
inline
"
);
ascii_art_text_area
.
focus
();
ascii_art_text_area
.
select
();
...
...
@@ -1181,11 +1180,13 @@ function ascii_entry_callback(textarea_state)
}
else
{
ascii_art_text_area
.
value
=
"
write your ascii art here
"
;
ascii_art
.
style
.
setProperty
(
"
display
"
,
"
none
"
);
w
.
canvas_events
[
canvas_events
.
get_previous_state
()]();
w
.
canvas_events
[
w
.
canvas_events
.
get_previous_state
()]();
}
});
}
exports
.
ascii_entry
=
ascii_entry
;
var
nw_app_quit
;
function
app_quit
()
{
...
...
pd/src/g_editor.c
View file @
aed90478
...
...
@@ -44,6 +44,7 @@ static int clipboard_istext = 0;
static
t_glist
*
glist_finddirty
(
t_glist
*
x
);
static
void
canvas_reselect
(
t_canvas
*
x
);
static
void
canvas_cut
(
t_canvas
*
x
);
static
void
canvas_ascii_entry
(
t_canvas
*
x
,
t_float
textarea_state
);
static
int
paste_xyoffset
=
0
;
/* a counter of pastes to make x,y offsets */
//static void canvas_mouseup_gop(t_canvas *x, t_gobj *g);
void
canvas_done_popup
(
t_canvas
*
x
,
t_float
which
,
t_float
xpos
,
...
...
@@ -170,6 +171,12 @@ static void canvas_nlet_conf (t_canvas *x, int type) {
1
);
}
static
void
canvas_ascii_entry
(
t_canvas
*
x
,
t_float
textarea_state
)
{
gui_vmess
(
"ascii_entry"
,
"xi"
,
x
,
textarea_state
);
}
void
canvas_getscroll
(
t_canvas
*
x
)
{
//sys_vgui("pdtk_canvas_getscroll .x%lx.c\n",(long)x);
gui_vmess
(
"gui_canvas_get_scroll"
,
"x"
,
x
);
...
...
@@ -7716,6 +7723,8 @@ void g_editor_setup(void)
gensym
(
"copyfromexternalbuffer"
),
A_GIMME
,
A_NULL
);
class_addmethod
(
canvas_class
,
(
t_method
)
canvas_reset_copyfromexternalbuffer
,
gensym
(
"reset_copyfromexternalbuffer"
),
A_NULL
);
class_addmethod
(
canvas_class
,
(
t_method
)
canvas_ascii_entry
,
gensym
(
"ascii-entry"
),
A_FLOAT
,
A_NULL
);
/* -------------- connect method used in reading files ------------------ */
class_addmethod
(
canvas_class
,
(
t_method
)
canvas_connect
,
gensym
(
"connect"
),
A_FLOAT
,
A_FLOAT
,
A_FLOAT
,
A_FLOAT
,
A_NULL
);
...
...
pd/src/m_glob.c
View file @
aed90478
...
...
@@ -101,12 +101,6 @@ static void glob_gui_properties(t_pd *dummy)
sys_autopatch_yoffset
);
}
//To enter or show ascii_art
extern
void
glob_ascii_entry
(
int
textarea_state
)
{
gui_vmess
(
"ascii_entry_callback"
,
textarea_state
);
}
// ths one lives inside g_editor so that it can access the clipboard
extern
void
glob_clipboard_text
(
t_pd
*
dummy
,
float
f
);
...
...
@@ -199,8 +193,6 @@ void glob_init(void)
gensym
(
"add-recent-file"
),
A_SYMBOL
,
0
);
class_addmethod
(
glob_pdobject
,
(
t_method
)
glob_clear_recent_files
,
gensym
(
"clear-recent-files"
),
0
);
class_addmethod
(
glob_pdobject
,
(
t_method
)
glob_ascii_entry
,
gensym
(
"toggle-ascii-entry"
),
0
);
#ifdef UNIX
class_addmethod
(
glob_pdobject
,
(
t_method
)
glob_watchdog
,
gensym
(
"watchdog"
),
0
);
...
...
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