Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
Esteban Blanc
proview
Commits
ab6bf4ff
Commit
ab6bf4ff
authored
Sep 13, 2016
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xtt script functions GetGraphInstance and GetGraphInstanceNext added
parent
b3de8c9c
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
131 additions
and
0 deletions
+131
-0
xtt/lib/ge/src/ge_graph.cpp
xtt/lib/ge/src/ge_graph.cpp
+8
-0
xtt/lib/ge/src/ge_graph.h
xtt/lib/ge/src/ge_graph.h
+1
-0
xtt/lib/xtt/src/xtt_applist.h
xtt/lib/xtt/src/xtt_applist.h
+2
-0
xtt/lib/xtt/src/xtt_ge.cpp
xtt/lib/xtt/src/xtt_ge.cpp
+5
-0
xtt/lib/xtt/src/xtt_ge.h
xtt/lib/xtt/src/xtt_ge.h
+1
-0
xtt/lib/xtt/src/xtt_xnav.cpp
xtt/lib/xtt/src/xtt_xnav.cpp
+37
-0
xtt/lib/xtt/src/xtt_xnav_command.cpp
xtt/lib/xtt/src/xtt_xnav_command.cpp
+77
-0
No files found.
xtt/lib/ge/src/ge_graph.cpp
View file @
ab6bf4ff
...
...
@@ -5680,6 +5680,14 @@ void Graph::close_input_all() {
grow_ResetInputFocusAll
(
grow
->
ctx
);
}
int
Graph
::
get_object_name
(
unsigned
int
idx
,
int
size
,
char
*
name
)
{
if
(
idx
>=
sizeof
(
object_name
)
/
sizeof
(
object_name
[
0
]))
return
0
;
strncpy
(
name
,
object_name
[
idx
],
size
);
return
1
;
}
static
void
graph_free_dyn
(
grow_tObject
object
)
{
if
(
grow_GetObjectType
(
object
)
==
glow_eObjectType_GrowNode
||
...
...
xtt/lib/ge/src/ge_graph.h
View file @
ab6bf4ff
...
...
@@ -1412,6 +1412,7 @@ class Graph {
int
key_pressed
(
int
key
);
void
close_input_all
();
int
get_object_name
(
unsigned
int
idx
,
int
size
,
char
*
name
);
static
int
get_colortheme_colors
(
char
*
file
,
double
**
colors
,
int
*
size
);
...
...
xtt/lib/xtt/src/xtt_applist.h
View file @
ab6bf4ff
...
...
@@ -94,6 +94,8 @@ class ApplList {
int
find
(
applist_eType
type
,
pwr_tObjid
objid
,
void
**
ctx
);
int
find
(
applist_eType
type
,
void
*
ctx
,
char
*
name
,
char
*
instance
);
int
find_graph
(
const
char
*
name
,
const
char
*
instance
,
void
**
ctx
);
int
find_graph_first
(
const
char
*
name
,
void
**
ctx
);
int
find_graph_next
(
const
char
*
name
,
char
*
instance
,
void
**
ctx
);
void
swap
(
int
mode
);
};
...
...
xtt/lib/xtt/src/xtt_ge.cpp
View file @
ab6bf4ff
...
...
@@ -277,6 +277,11 @@ void XttGe::close_input_all()
graph
->
close_input_all
();
}
int
XttGe
::
get_object_name
(
unsigned
int
idx
,
int
size
,
char
*
name
)
{
return
graph
->
get_object_name
(
idx
,
size
,
name
);
}
XttGe
::
XttGe
(
void
*
xg_parent_ctx
,
const
char
*
xg_name
,
const
char
*
xg_filename
,
int
xg_scrollbar
,
int
xg_menu
,
int
xg_navigator
,
int
xg_width
,
int
xg_height
,
int
x
,
int
y
,
double
scan_time
,
const
char
*
object_name
,
...
...
xtt/lib/xtt/src/xtt_ge.h
View file @
ab6bf4ff
...
...
@@ -104,6 +104,7 @@ class XttGe : XttUtility {
void
set_text_coding
(
lng_eCoding
coding
);
int
key_pressed
(
int
key
);
void
close_input_all
();
int
get_object_name
(
unsigned
int
idx
,
int
size
,
char
*
name
);
static
void
graph_init_cb
(
void
*
client_data
);
static
int
graph_close_cb
(
void
*
client_data
);
...
...
xtt/lib/xtt/src/xtt_xnav.cpp
View file @
ab6bf4ff
...
...
@@ -4162,6 +4162,43 @@ int ApplList::find_graph( const char *name, const char *instance, void **ctx)
return
0
;
}
int
ApplList
::
find_graph_first
(
const
char
*
name
,
void
**
ctx
)
{
ApplListElem
*
elem
;
for
(
elem
=
root
;
elem
;
elem
=
elem
->
next
)
{
if
(
elem
->
type
==
applist_eType_Graph
)
{
if
(
cdh_NoCaseStrcmp
(
name
,
elem
->
name
)
==
0
)
{
*
ctx
=
elem
->
ctx
;
return
1
;
}
}
}
return
0
;
}
int
ApplList
::
find_graph_next
(
const
char
*
name
,
char
*
instance
,
void
**
ctx
)
{
ApplListElem
*
elem
;
int
found
=
0
;
for
(
elem
=
root
;
elem
;
elem
=
elem
->
next
)
{
if
(
elem
->
type
==
applist_eType_Graph
)
{
if
(
cdh_NoCaseStrcmp
(
name
,
elem
->
name
)
==
0
)
{
if
(
found
)
{
*
ctx
=
elem
->
ctx
;
return
1
;
}
else
{
if
(
cdh_NoCaseStrcmp
(
instance
,
elem
->
instance
)
==
0
)
found
=
1
;
}
}
}
}
return
0
;
}
int
ApplList
::
find
(
applist_eType
type
,
void
*
ctx
,
char
*
name
,
char
*
instance
)
{
ApplListElem
*
elem
;
...
...
xtt/lib/xtt/src/xtt_xnav_command.cpp
View file @
ab6bf4ff
...
...
@@ -8648,6 +8648,79 @@ static int xnav_getprivileges_func(
return
1
;
}
static
int
xnav_getgraphinstance_func
(
void
*
filectx
,
ccm_sArg
*
arg_list
,
int
arg_count
,
int
*
return_decl
,
ccm_tFloat
*
return_float
,
ccm_tInt
*
return_int
,
char
*
return_string
)
{
XNav
*
xnav
;
XttGe
*
gectx
;
int
sts
;
if
(
arg_count
!=
1
)
return
CCM__ARGMISM
;
if
(
arg_list
->
value_decl
!=
CCM_DECL_STRING
)
return
CCM__ARGMISM
;
xnav_get_stored_xnav
(
&
xnav
);
if
(
xnav
->
appl
.
find_graph_first
(
arg_list
->
value_string
,
(
void
**
)
&
gectx
))
{
sts
=
gectx
->
get_object_name
(
0
,
sizeof
(
ccm_tString
),
return_string
);
if
(
EVEN
(
sts
))
strcpy
(
return_string
,
""
);
}
else
strcpy
(
return_string
,
""
);
*
return_decl
=
CCM_DECL_STRING
;
return
1
;
}
static
int
xnav_getgraphinstancenext_func
(
void
*
filectx
,
ccm_sArg
*
arg_list
,
int
arg_count
,
int
*
return_decl
,
ccm_tFloat
*
return_float
,
ccm_tInt
*
return_int
,
char
*
return_string
)
{
XNav
*
xnav
;
XttGe
*
gectx
;
int
sts
;
ccm_sArg
*
arg_p2
;
if
(
arg_count
!=
2
)
return
CCM__ARGMISM
;
arg_p2
=
arg_list
->
next
;
if
(
arg_list
->
value_decl
!=
CCM_DECL_STRING
)
return
CCM__ARGMISM
;
if
(
arg_p2
->
value_decl
!=
CCM_DECL_STRING
)
return
CCM__ARGMISM
;
xnav_get_stored_xnav
(
&
xnav
);
if
(
xnav
->
appl
.
find_graph_next
(
arg_list
->
value_string
,
arg_p2
->
value_string
,
(
void
**
)
&
gectx
))
{
sts
=
gectx
->
get_object_name
(
0
,
sizeof
(
ccm_tString
),
return_string
);
if
(
EVEN
(
sts
))
strcpy
(
return_string
,
""
);
}
else
strcpy
(
return_string
,
""
);
*
return_decl
=
CCM_DECL_STRING
;
return
1
;
}
static
int
xnav_ccm_deffilename_func
(
char
*
outfile
,
char
*
infile
,
void
*
client_data
)
{
pwr_tFileName
fname
;
...
...
@@ -8731,6 +8804,10 @@ int XNav::readcmdfile( char *incommand, char *buffer)
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ccm_register_function
(
"GetPrivileges"
,
xnav_getprivileges_func
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ccm_register_function
(
"GetGraphInstance"
,
xnav_getgraphinstance_func
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ccm_register_function
(
"GetGraphInstanceNext"
,
xnav_getgraphinstancenext_func
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
ccm_create_external_var
(
"GLOW__SUBTERMINATED"
,
CCM_DECL_INT
,
0
,
GLOW__SUBTERMINATED
,
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