11#ifndef __GRAPH_DEF_HPP
12#define __GRAPH_DEF_HPP
31#define NIF_BG_COLOR (1 << 0)
32#define NIF_FRAME_COLOR (1 << 1)
33#define NIF_EA (1 << 2)
34#define NIF_TEXT (1 << 3)
35#define NIF_FLAGS (1 << 4)
36#define NIF_ALL (NIF_BG_COLOR | NIF_FRAME_COLOR | NIF_EA | NIF_TEXT | NIF_FLAGS)
43#define GLICTL_CENTER (1 << 0)
54#define NIFF_SHOW_CONTENTS (1 << 0)
133 void idaapi
reinit(
void) { visited.clear(); }
182 template <
class T>
void div(T d)
197 const char *idaapi
dstr(
void)
const;
206 double dx = q.
x - p.
x;
207 double dy = q.
y - p.
y;
208 return sqrt(dx*dx+dy*dy);
215 const char *idaapi
dstr(
void)
const;
232 :
left (qmin(p0.x, p1.x)),
233 top (qmin(p0.y, p1.y)),
234 right (qmax(p0.x, p1.x)),
328 const TRect &
operator()(
void)
const {
return *(TRect *)
this; }
359 template <
class T>
void div(T d)
390#if !defined(_MSC_VER) || _MSC_VER >= 1600
417 return !(*
this == r);
441 return elp.compare(r.
elp);
481 for (
size_t i = 0, sz =
size(); i < sz; ++i )
482 if (
at(i).is_node == look_for_nodes )
591static const int ygap = 30;
592static const int xgap = 10;
593static const int arrow_height = 10;
594static const int arrow_width = 8;
603 void idaapi find_entries(
node_set_t &entries)
const;
604 void idaapi depth_first(
int root,
struct depth_first_info_t &di)
const;
605 size_t idaapi remove_reachable(
int n,
node_set_t *s)
const;
606 int idaapi longest_path(
int n,
intvec_t &tops,
int row_height)
const;
607 size_t idaapi sort_layer_nodes(
613 size_t idaapi calc_cross_num(
619 int idaapi calc_x_coord(
const row_info_t &ri,
int idx,
bool ispred,
int first_added_node)
const;
620 void idaapi try_move_down(
intvec_t &tops,
int n,
int row_height)
const;
632 int row_height)
const;
638 int first_reverser_node,
639 int row_height)
const;
645 int graph_height)
const;
657 int first_added_node);
662 edge_segs_vec_t &ges)
const;
667 const edge_segs_vec_t &ges,
668 int first_reverser_node);
677 const edgeset_t &back_edges,
678 const edge_infos_t &self_edges);
686 edge_typer_t *et)
const;
691 edgeset_t *back_edges,
777#if defined(__GNUC__) && (defined(__KERNEL__) || !defined(__UI__))
778#define GCC_PUREVIRT = 0
796#define CHKNODEIDX(n) QASSERT(1385, int(n) >= 0)
879 int idaapi _find_subgraph_node(
int group,
int n)
const;
880 void idaapi collapse_edges(
const intvec_t &
nodes,
int group);
881 void idaapi del_node_keep_edges(
int n);
882 void idaapi add_dest(destset_t &ne,
edge_t e,
int g);
883 void idaapi reverse_edges(
884 const edgeset_t &back_edges,
885 edge_infos_t &self_edges,
887 void idaapi layout_self_reference_edges(
const edge_infos_t &selfrefs);
888 void idaapi restore_edges(
int first_reserver_node,
bool failed);
892 void idaapi fix_collapsed_group_edges(
void);
901#define MTG_GROUP_NODE 0x01
902#define MTG_DOT_NODE 0x02
903#define MTG_NON_DISPLAYABLE_NODE 0x08
927 virtual int idaapi
size(
void)
const override {
return int(
succs.size()); }
935 virtual int idaapi
node_qty(
void)
const override;
939 void idaapi
clear(
void);
943 virtual bool idaapi
empty(
void)
const override;
950#define COLLAPSED_NODE 0x80000000
1028 virtual int idaapi
nsucc(
int b)
const override { CHKNODEIDX(b);
return (
int)
succs[b].size(); }
1029 virtual int idaapi
npred(
int b)
const override { CHKNODEIDX(b);
return (
int)
preds[b].size(); }
1030 virtual int idaapi
succ(
int b,
int i)
const override { CHKNODEIDX(b);
return succs[b][i]; }
1031 virtual int idaapi
pred(
int b,
int i)
const override { CHKNODEIDX(b);
return preds[b][i]; }
1061 virtual bool idaapi
del_edge(
int i,
int j) GCC_PUREVIRT;
1541 int new_current = -1)
1557 int new_current = -1)
1560 expand, new_current) == 1;
Vector of bytes (use for dynamic memory)
Definition pro.h:3773
qstring title
graph title
Definition graph.hpp:709
bool idaapi calc_fitting_params(const rect_t &area, graph_location_info_t *gli, double max_zoom)
void idaapi create_spanning_tree(edge_typer_t *et, node_set_t *entries, edgeset_t *back_edges, node_ordering_t *pre, node_ordering_t *post) const
virtual edge_info_t *idaapi get_edge(edge_t e)=0
void idaapi get_connected_components(intvec_t &entries) const
Returns one entry point for each connected component.
bool idaapi create_polar_tree_layout(point_t p, int radius)
bool rect_edges_made
have create rectangular edges?
Definition graph.hpp:710
void idaapi set_x_coords(const graph_row_info_t &gri, const node_set_t &selfrefs, int first_added_node)
Calculate x coords of all nodes.
int idaapi for_all_nodes_edges(graph_visitor_t &nev, bool visit_nodes=true)
int idaapi calc_longest_pathes(const node_set_t &entries, intvec_t &tops, int row_height) const
Find longest paths from the entries.
int idaapi visit_nodes(int node, graph_node_visitor_t &gv) const
Visit nodes starting from 'node', depth first.
bool idaapi path_back(edge_typer_t &et, int m, int n) const
int idaapi visit_paths(int node, graph_path_visitor_t &gv) const
Visit all possible paths starting from 'node'.
const rect_t &idaapi nrect(int n) const
Definition graph.hpp:738
bool idaapi create_orthogonal_layout(void)
const edge_info_t *idaapi get_edge(edge_t e) const
Definition graph.hpp:740
point_t circle_center
for layout_circle
Definition graph.hpp:712
void idaapi create_graph_row_info(const intvec_t &tops, graph_row_info_t &gri, int graph_height) const
Create graph row info from 'tops'.
void idaapi minimize_crossings(graph_row_info_t &gri) const
Minimize crossings.
void set_callback(hook_cb_t *_callback, void *_ud)
Definition graph.hpp:752
hook_cb_t * callback
user-defined callback
Definition graph.hpp:714
int circle_radius
for layout_circle
Definition graph.hpp:713
bool idaapi create_radial_tree_layout(point_t p, int radius)
void idaapi recalc_edge_widths(const edgeset_t &back_edges, const edge_infos_t &self_edges)
Recalculate width of all edges.
layout_type_t current_layout
see Proximity view layouts
Definition graph.hpp:711
const edge_info_t *idaapi get_edge_ports(edge_t e, point_t &s, point_t &d) const
void * callback_ud
user data for callback
Definition graph.hpp:715
void idaapi move_nodes_down(intvec_t &tops, const node_ordering_t &post, int first_reverser_node, int row_height) const
Move entry nodes down as much as possible.
bool idaapi calc_bounds(rect_t *r)
void idaapi clear_layout_info(void)
Clear layout information in the graph.
void idaapi assign_edge_ports(const graph_row_info_t &gri, const node_set_t &selfrefs)
Assign ports to edges.
void idaapi dump_graph(const char *header) const
virtual rect_t &idaapi nrect(int n)=0
bool idaapi create_circle_layout(point_t p, int radius)
Definition graph.hpp:1613
ssize_t vgrcall(int code, va_list va)
Definition graph.hpp:757
void idaapi calc_fitting_params(const rect_t &area, const rect_t &r, graph_location_info_t *gli, double max_zoom)
virtual ~drawable_graph_t()
Definition graph.hpp:717
virtual drawable_graph_t *idaapi clone(void) const =0
void idaapi make_rect_edges(graph_row_info_t &gri, const edge_segs_vec_t &ges, int first_reverser_node)
Make all edges rectangular.
bool idaapi create_tree_layout(void)
Definition graph.hpp:1612
void idaapi depth_first(node_ordering_t *pre, node_ordering_t *post, edge_typer_t *et) const
void idaapi calc_row_heights(graph_row_info_t &gri) const
Calculate height of each row.
bool idaapi path_back(const array_of_node_set_t &domin, int m, int n) const
Is there a path from M to N which terminates with a back edge to N?
void idaapi add_node_edges(edgevec_t &dlist, int node)
void idaapi tree_layout(edge_typer_t &et, const node_set_t &entries)
ssize_t grcall(int code,...)
Definition graph.hpp:763
void idaapi gather_edge_segments(const graph_row_info_t &gri, edge_segs_vec_t &ges) const
Gather information about all edge segments.
gdl graph interface - includes only functions required to draw it
Definition gdl.hpp:248
Describes a sub-item of a graph.
Definition graph.hpp:524
graph_item_type_t type
type
Definition graph.hpp:526
int b
button number
Definition graph.hpp:529
point_t p
text coordinates in the node
Definition graph.hpp:530
int n
node number
Definition graph.hpp:528
edge_t e
edge source and destination
Definition graph.hpp:527
bool operator==(const graph_item_t &r) const
bool is_edge(void) const
Definition graph.hpp:534
edge_layout_point_t elp
edge layout point
Definition graph.hpp:531
bool is_node(void) const
Definition graph.hpp:533
Node visitor - see drawable_graph_t::visit_nodes()
Definition graph.hpp:129
void idaapi reinit(void)
Reset visited nodes.
Definition graph.hpp:133
virtual bool idaapi is_forbidden_edge(int, int) const
Should the edge between 'n' and 'm' be ignored?
Definition graph.hpp:142
bool idaapi is_visited(int n) const
Have we already visited the given node?
Definition graph.hpp:137
void idaapi set_visited(int n)
Mark node as visited.
Definition graph.hpp:135
virtual ~graph_node_visitor_t()
Definition graph.hpp:144
virtual int idaapi visit_node(int)
Implements action to take when a node is visited.
Definition graph.hpp:140
Visit all nodes and edges in a graph.
Definition graph.hpp:1116
virtual ~graph_visitor_t()
Definition graph.hpp:1118
virtual int idaapi visit_node(int n, rect_t &r)=0
drawable_graph_t * g
Definition graph.hpp:1120
virtual int idaapi visit_edge(edge_t e, edge_info_t *ei)=0
The base class used to display graphs in IDA.
Definition graph.hpp:877
virtual bool idaapi refresh(void) GCC_PUREVIRT
Refresh the graph.
const intvec_t &idaapi succset(int b) const
Definition graph.hpp:1032
idaapi interactive_graph_t(const drawable_graph_t &g, uval_t id)
virtual interactive_graph_t *idaapi clone(void) const override GCC_PUREVIRT
node_layout_t nodes
Definition graph.hpp:914
bool idaapi get_graph_groups(void)
Definition graph.hpp:1618
virtual int idaapi npred(int b) const override
Definition graph.hpp:1029
qvector< rect_t > node_layout_t
Definition graph.hpp:913
int idaapi create_group(const intvec_t &nodes)
Create a new group node, that will contain all the nodes in 'nodes'.
Definition graph.hpp:1616
bool idaapi get_custom_layout(void)
Definition graph.hpp:1617
bool idaapi is_collapsed_node(int node) const
Definition graph.hpp:974
virtual edge_info_t *idaapi get_edge(edge_t e) override GCC_PUREVIRT
idaapi interactive_graph_t(uval_t id)
edge_infos_wrapper_t edges
Definition graph.hpp:915
int idaapi get_node_representative(int node)
Get the node that currently visually represents 'node'.
Definition graph.hpp:1614
virtual int idaapi succ(int b, int i) const override
Definition graph.hpp:1030
virtual int idaapi add_node(const rect_t *r) GCC_PUREVIRT
Add a node, possibly with a specific geometry.
virtual bool idaapi redo_layout(void) GCC_PUREVIRT
Recompute the layout, according to the value of 'current_layout'.
virtual int idaapi pred(int b, int i) const override
Definition graph.hpp:1031
virtual void idaapi resize(int n) GCC_PUREVIRT
Resize the graph to 'n' nodes.
point_t idaapi calc_center_of(const intvec_t &nodes) const
virtual int idaapi nsucc(int b) const override
Definition graph.hpp:1028
uval_t gid
graph id - unique for the database for flowcharts it is equal to the function start_ea
Definition graph.hpp:895
virtual bool idaapi replace_edge(int i, int j, int x, int y) GCC_PUREVIRT
void idaapi set_deleted_node(int node)
Definition graph.hpp:968
virtual bool idaapi del_edge(int i, int j) GCC_PUREVIRT
bool idaapi is_simple_node(int node) const
Definition graph.hpp:973
void idaapi reset(void)
Definition graph.hpp:1035
int idaapi get_first_subgraph_node(int group) const
Definition graph.hpp:992
void idaapi insert_simple_nodes(intvec_t &nodes, int group) const
bool idaapi change_visibility(const intvec_t &nodes, bool expand)
Change visibility of multiple group nodes.
const intvec_t &idaapi predset(int b) const
Definition graph.hpp:1033
bool idaapi is_group_node(int node) const
Definition graph.hpp:971
void idaapi del_custom_layout(void)
Definition graph.hpp:1607
virtual int idaapi size(void) const override
Get the total number of nodes (including group nodes, and including hidden nodes.)
Definition graph.hpp:927
virtual bool idaapi set_edge(edge_t e, const edge_info_t *ei) GCC_PUREVIRT
Definition graph.hpp:1623
virtual bool idaapi empty(void) const override
Is the graph (visually) empty?
Definition graph.hpp:1619
virtual ssize_t idaapi del_node(int n) GCC_PUREVIRT
Delete a node.
bool idaapi is_visible_node(int node) const
Is the node currently visible?
Definition graph.hpp:1620
void idaapi set_node_group(int node, int group)
Definition graph.hpp:966
intvec_t belongs
the subgraph the node belongs to INT_MAX means that the node doesn't exist sign bit means collapsed n...
Definition graph.hpp:897
virtual bool idaapi is_user_graph() new api
Definition graph.hpp:1110
bool idaapi is_deleted_node(int node) const
Definition graph.hpp:967
bool idaapi change_group_visibility(int group, bool expand)
Expand/collapse a group node.
Definition graph.hpp:1622
bool idaapi is_displayable_node(int node) const
Definition graph.hpp:972
virtual int idaapi node_qty(void) const override
Get the number of visible nodes (the list can be retrieved using gdl.hpp's node_iterator)
Definition graph.hpp:1624
void idaapi move_to_same_place(const intvec_t &collapsing_nodes, point_t p)
bytevec_t node_flags
node flags
Definition graph.hpp:900
void idaapi set_graph_groups(void) const
Definition graph.hpp:1609
bool idaapi is_subgraph_node(int node) const
Definition graph.hpp:969
int idaapi get_next_subgraph_node(int group, int current) const
Definition graph.hpp:993
array_of_intvec_t succs
Definition graph.hpp:911
bool idaapi is_dot_node(int node) const
Definition graph.hpp:970
bool idaapi is_uncollapsed_node(int node) const
Definition graph.hpp:975
void idaapi move_grouped_nodes(const intvec_t &groups, const interactive_graph_t *ng)
void idaapi set_custom_layout(void) const
Definition graph.hpp:1608
bool idaapi groups_are_present(void) const
Is there any group node in the graph?
bool idaapi check_new_group(const intvec_t &nodes, intvec_t &refined)
bool idaapi create_digraph_layout(void)
Definition graph.hpp:1611
virtual bool idaapi exists(int node) const override
Is the node visible?
Definition graph.hpp:949
void idaapi insert_visible_nodes(intvec_t &nodes, int group) const
array_of_intvec_t org_preds
Definition graph.hpp:909
virtual ~interactive_graph_t()
Definition graph.hpp:919
virtual ea_t idaapi calc_group_ea(const intvec_t &) new api
Definition graph.hpp:1104
bool idaapi delete_group(int group)
Delete a group node.
Definition graph.hpp:1621
array_of_intvec_t org_succs
Definition graph.hpp:908
int idaapi get_node_group(int node) const
Definition graph.hpp:965
array_of_intvec_t preds
Definition graph.hpp:912
void idaapi clear(void)
Clears all nodes & edges information in this instance (does not remove node_info_t stored in the data...
Definition graph.hpp:1610
virtual bool idaapi add_edge(int i, int j, const edge_info_t *ei) GCC_PUREVIRT
const rect_t &idaapi nrect(int n) const
Definition graph.hpp:1089
virtual bool idaapi set_nrect(int n, const rect_t &r) GCC_PUREVIRT
Map of integer constants to integer constants.
Definition gdl.hpp:74
Node ordering in a graph.
Definition gdl.hpp:142
Set of graph nodes.
Definition gdl.hpp:121
place_t()
Constructor.
Definition kernwin.hpp:1421
Ordered sequence of points.
Definition graph.hpp:213
const char *idaapi dstr(void) const
size_t idaapi print(char *buf, size_t bufsize) const
Reimplementation of vector class from STL.
Definition pro.h:2250
const selection_item_t * const_iterator
Definition pro.h:2607
bool del(const selection_item_t &x)
Definition pro.h:2749
iterator end(void)
Definition pro.h:2610
const selection_item_t & at(size_t _idx) const
Definition pro.h:2427
iterator find(const selection_item_t &x)
Definition pro.h:2703
iterator begin(void)
Get an iterator that points to the first element in the qvector.
Definition pro.h:2609
size_t size(void) const
Definition pro.h:2423
bool add_unique(const selection_item_t &x)
Definition pro.h:2739
Low level graph drawing operations.
qvector< node_set_t > array_of_node_set_t
Definition gdl.hpp:135
qvector< intmap_t > array_of_intmap_t
Definition gdl.hpp:81
DECLARE_HELPER(idaman) class intset_t typedef qvector< intvec_t > array_of_intvec_t
Set of integer constants.
Definition gdl.hpp:52
DECLARE_TYPE_AS_MOVABLE(point_t)
graph_viewer_t *idaapi get_graph_viewer(TWidget *parent)
Get custom graph viewer for given form.
Definition graph.hpp:1407
void idaapi refresh_viewer(graph_viewer_t *gv)
Redraw the graph in the given view.
Definition graph.hpp:1437
bool idaapi viewer_delete_groups(graph_viewer_t *gv, const intvec_t &groups, int new_current=-1)
Wrapper around interactive_graph_t::delete_group.
Definition graph.hpp:1538
bool idaapi viewer_set_groups_visibility(graph_viewer_t *gv, const intvec_t &groups, bool expand, int new_current=-1)
Wrapper around interactive_graph_t::change_visibility.
Definition graph.hpp:1553
interactive_graph_t *idaapi create_disasm_graph(ea_t ea)
Create a graph for the function that contains 'ea'.
Definition graph.hpp:1417
void idaapi viewer_set_gli(graph_viewer_t *gv, const graph_location_info_t *gli, uint32 flags=0)
Set location info for given graph view If flags contains GLICTL_CENTER, then the gli will be set to b...
Definition graph.hpp:1458
qvector< group_crinfo_t > groups_crinfos_t
Definition graph.hpp:1374
int idaapi viewer_get_curnode(graph_viewer_t *gv)
Get number of currently selected node (-1 if none)
Definition graph.hpp:1447
bool idaapi viewer_attach_menu_item(graph_viewer_t *g, const char *name)
Attach a previously-registered action to the view's context menu.
Definition graph.hpp:1570
graph_notification_t
Graph notification codes.
Definition graph.hpp:1129
@ grcode_viewer_delete_groups_vec
use viewer_delete_groups()
Definition graph.hpp:1331
@ grcode_del_custom_layout
use interactive_graph_t::del_custom_layout()
Definition graph.hpp:1295
@ grcode_viewer_create_groups
Definition graph.hpp:1325
@ grcode_get_selection
use viewer_get_selection()
Definition graph.hpp:1292
@ grcode_nrect
use interactive_graph_t::nrect()
Definition graph.hpp:1313
@ grcode_create_disasm_graph2
use create_disasm_graph(const rangevec_t &ranges)
Definition graph.hpp:1319
@ grcode_viewer_groups_visibility_vec
use viewer_set_groups_visibility()
Definition graph.hpp:1332
@ grcode_gotfocus
a graph viewer got focus.
Definition graph.hpp:1200
@ grcode_get_graph_groups
use interactive_graph_t::get_graph_groups()
Definition graph.hpp:1306
@ grcode_create_disasm_graph1
use create_disasm_graph(ea_t ea)
Definition graph.hpp:1318
@ grcode_center_on
use viewer_center_on()
Definition graph.hpp:1291
@ grcode_change_group_visibility
use interactive_graph_t::change_group_visibility()
Definition graph.hpp:1310
@ grcode_reserved
Definition graph.hpp:1146
@ grcode_is_visible_node
use interactive_graph_t::is_visible_node()
Definition graph.hpp:1308
@ grcode_changed_graph
new graph has been set.
Definition graph.hpp:1142
@ grcode_create_user_graph_place
use create_user_graph_place()
Definition graph.hpp:1317
@ grcode_create_digraph_layout
use interactive_graph_t::create_digraph_layout()
Definition graph.hpp:1299
@ grcode_deleting_group
a group is being deleted.
Definition graph.hpp:1177
@ grcode_attach_menu_item
Definition graph.hpp:1338
@ grcode_delete_group
use interactive_graph_t::delete_group()
Definition graph.hpp:1309
@ grcode_creating_group
a group is being created.
Definition graph.hpp:1166
@ grcode_create_group
use interactive_graph_t::create_group()
Definition graph.hpp:1304
@ grcode_create_interactive_graph
use create_interactive_graph()
Definition graph.hpp:1286
@ grcode_viewer_groups_visibility
Definition graph.hpp:1327
@ grcode_get_node_representative
use interactive_graph_t::get_node_representative()
Definition graph.hpp:1302
@ grcode_get_custom_layout
use interactive_graph_t::get_custom_layout()
Definition graph.hpp:1305
@ grcode_fit_window
use viewer_fit_window()
Definition graph.hpp:1289
@ grcode_create_tree_layout
use drawable_graph_t::create_tree_layout()
Definition graph.hpp:1300
@ grcode_set_edge
use interactive_graph_t::set_edge()
Definition graph.hpp:1311
@ grcode_user_hint
retrieve hint for the user-defined graph.
Definition graph.hpp:1256
@ grcode_set_gli
use viewer_set_gli()
Definition graph.hpp:1341
@ grcode_group_visibility
a group is being collapsed/uncollapsed this provides an opportunity for the graph to forbid changing ...
Definition graph.hpp:1188
@ grcode_viewer_create_groups_vec
use viewer_create_groups()
Definition graph.hpp:1330
@ grcode_delete_interactive_graph
use delete_interactive_graph()
Definition graph.hpp:1333
@ grcode_find_subgraph_node
use interactive_graph_t::_find_subgraph_node()
Definition graph.hpp:1303
@ grcode_create_graph_viewer
use create_graph_viewer()
Definition graph.hpp:1283
@ grcode_empty
use interactive_graph_t::empty()
Definition graph.hpp:1307
@ grcode_user_title
render node title of a user-defined graph.
Definition graph.hpp:1238
@ grcode_set_viewer_graph
use set_viewer_graph()
Definition graph.hpp:1287
@ grcode_get_curnode
use viewer_get_curnode()
Definition graph.hpp:1290
@ grcode_set_titlebar_height
use viewer_set_titlebar_height()
Definition graph.hpp:1316
@ grcode_clicked
graph is being clicked.
Definition graph.hpp:1148
@ grcode_set_custom_layout
use interactive_graph_t::set_custom_layout()
Definition graph.hpp:1296
@ grcode_reserved2
Definition graph.hpp:1220
@ grcode_destroyed
graph is being destroyed.
Definition graph.hpp:1265
@ grcode_get_graph_viewer
use get_graph_viewer()
Definition graph.hpp:1284
@ grcode_user_draw
render node of a user-defined graph.
Definition graph.hpp:1247
@ grcode_user_text
retrieve text for user-defined graph node.
Definition graph.hpp:1222
@ grcode_user_size
calculate node size for user-defined graph.
Definition graph.hpp:1230
@ grcode_viewer_delete_groups
Definition graph.hpp:1326
@ grcode_edge_infos_wrapper_clear
use edge_infos_wrapper_t::clear()
Definition graph.hpp:1335
@ grcode_set_graph_groups
use interactive_graph_t::set_graph_groups()
Definition graph.hpp:1297
@ grcode_calculating_layout
calculating user-defined graph layout.
Definition graph.hpp:1132
@ grcode_lostfocus
a graph viewer lost focus.
Definition graph.hpp:1204
@ grcode_get_viewer_graph
use get_viewer_graph()
Definition graph.hpp:1285
@ grcode_set_node_info
use viewer_set_node_info()
Definition graph.hpp:1320
@ grcode_create_circle_layout
use drawable_graph_t::create_circle_layout()
Definition graph.hpp:1301
@ grcode_user_refresh
refresh user-defined graph nodes and edges This is called when the UI considers that it is necessary ...
Definition graph.hpp:1208
@ grcode_refresh_viewer
use refresh_viewer()
Definition graph.hpp:1288
@ grcode_del_node_info
use viewer_del_node_info()
Definition graph.hpp:1322
@ grcode_layout_calculated
graph layout calculated.
Definition graph.hpp:1137
@ grcode_node_qty
use interactive_graph_t::node_qty()
Definition graph.hpp:1312
@ grcode_get_gli
use viewer_get_gli()
Definition graph.hpp:1342
@ grcode_dblclicked
a graph node has been double clicked.
Definition graph.hpp:1160
@ grcode_clear
use interactive_graph_t::clear()
Definition graph.hpp:1298
@ grcode_edge_infos_wrapper_copy
use edge_infos_wrapper_t::operator=()
Definition graph.hpp:1334
@ grcode_get_node_info
use viewer_get_node_info()
Definition graph.hpp:1321
int layout_type_t
see Proximity view layouts
Definition graph.hpp:369
bool idaapi viewer_get_gli(graph_location_info_t *out, graph_viewer_t *gv, uint32 flags=0)
Get location info for given graph view If flags contains GLICTL_CENTER, then the gli that will be ret...
Definition graph.hpp:1471
interactive_graph_t *idaapi get_viewer_graph(graph_viewer_t *gv)
Get graph object for given custom graph viewer.
Definition graph.hpp:1427
TWidget graph_viewer_t
graph view opaque structure
Definition graph.hpp:1378
qvector< selection_item_t > screen_graph_selection_base_t
Selection in a graph.
Definition graph.hpp:455
bool idaapi viewer_get_node_info(graph_viewer_t *gv, node_info_t *out, int n)
Get node info for node in given viewer (see get_node_info())
Definition graph.hpp:1494
int idaapi viewer_set_titlebar_height(graph_viewer_t *gv, int height)
Set height of node title bars (grcode_set_titlebar_height)
Definition graph.hpp:1588
graph_item_type_t
See graph_item_t.
Definition graph.hpp:513
@ git_text
node text (graph_item_t::n, graph_item_t::p)
Definition graph.hpp:518
@ git_edge
edge (graph_item_t::e, graph_item_t::n. n is farthest edge endpoint)
Definition graph.hpp:515
@ git_none
nothing
Definition graph.hpp:514
@ git_node
node title (graph_item_t::n)
Definition graph.hpp:516
@ git_tool
node title button (graph_item_t::n, graph_item_t::b)
Definition graph.hpp:517
@ git_elp
edge layout point (graph_item_t::elp)
Definition graph.hpp:519
THREAD_SAFE double calc_dist(point_t p, point_t q)
Calculate distance between p and q.
Definition graph.hpp:204
idaman void ida_export del_node_info(graph_id_t gid, int node)
Delete the node_info_t for the given node.
bool idaapi viewer_create_groups(graph_viewer_t *gv, intvec_t *out_group_nodes, const groups_crinfos_t &gi)
This will perform an operation similar to what happens when a user manually selects a set of nodes,...
Definition graph.hpp:1523
void idaapi delete_interactive_graph(interactive_graph_t *g)
Delete graph object.
Definition graph.hpp:1601
ea_t graph_id_t
Graph instances have a unique id (see interactive_graph_t::gid)
Definition graph.hpp:89
idaman void ida_export clr_node_info(graph_id_t gid, int node, uint32 flags)
Clear node info for the given node.
idaman bool ida_export get_node_info(node_info_t *out, graph_id_t gid, int node)
Get node info.
user_graph_place_t * create_user_graph_place(int node, int lnnum)
Get a copy of a user_graph_place_t (returns a pointer to static storage)
Definition graph.hpp:1649
idaman void ida_export set_node_info(graph_id_t gid, int node, const node_info_t &ni, uint32 flags)
Set node info.
void idaapi viewer_set_node_info(graph_viewer_t *gv, int n, const node_info_t &ni, uint32 flags)
Set node info for node in given viewer (see set_node_info())
Definition graph.hpp:1482
bool idaapi viewer_get_selection(graph_viewer_t *gv, screen_graph_selection_t *sgs)
Get currently selected items for graph viewer.
Definition graph.hpp:1578
void idaapi viewer_center_on(graph_viewer_t *gv, int node)
Center the graph view on the given node.
Definition graph.hpp:1452
qvector< row_info_t > graph_row_info_t
vector of row infos
Definition graph.hpp:589
graph_viewer_t *idaapi create_graph_viewer(const char *title, uval_t id, hook_cb_t *callback, void *ud, int title_height, TWidget *parent=nullptr)
Create a custom graph viewer.
Definition graph.hpp:1391
ssize_t grentry(graph_notification_t event_code,...)
Definition graph.hpp:1356
void idaapi set_viewer_graph(graph_viewer_t *gv, interactive_graph_t *g)
Set the underlying graph object for the given viewer.
Definition graph.hpp:1432
void idaapi viewer_del_node_info(graph_viewer_t *gv, int n)
Delete node info for node in given viewer (see del_node_info())
Definition graph.hpp:1505
interactive_graph_t *idaapi create_interactive_graph(uval_t id)
Create a new empty graph with given id.
Definition graph.hpp:1412
qvector< point_t > pointvec_t
Definition graph.hpp:201
void idaapi viewer_fit_window(graph_viewer_t *gv)
Fit graph viewer to its parent form.
Definition graph.hpp:1442
const layout_type_t layout_digraph
Definition graph.hpp:374
const layout_type_t layout_tree
Definition graph.hpp:375
const layout_type_t layout_orthogonal
Definition graph.hpp:378
const layout_type_t layout_radial_tree
Definition graph.hpp:379
const layout_type_t layout_polar_tree
Definition graph.hpp:377
const layout_type_t layout_none
Definition graph.hpp:373
const layout_type_t layout_circle
Definition graph.hpp:376
idaman THREAD_SAFE va_list va
See qsscanf()
Definition err.h:21
THREAD_SAFE va_start(va, format)
int code
Definition fpro.h:88
idaman size_t n
Definition pro.h:997
cexpr_t * e
Definition hexrays.hpp:7308
@ HT_GRAPH
Handling graph operations (graph_notification_t)
Definition ida.hpp:1309
ssize_t idaapi hook_cb_t(void *user_data, int notification_code, va_list va)
Callback provided to hook_to_notification_point().
Definition ida.hpp:1332
idaman ssize_t ida_export invoke_callbacks(hook_type_t hook_type, int notification_code, va_list va)
Generate event notification.
Contains definition of the interface to IDP modules.
Defines the interface between the kernel and the UI.
uval_t uval_t
Definition kernwin.hpp:1878
QT::QWidget TWidget
Definition kernwin.hpp:2024
bool result
Definition kernwin.hpp:7890
This is the first header included in the IDA project.
idaman size_t const char time_t t
Definition pro.h:602
unsigned int uint32
unsigned 32 bit value
Definition pro.h:348
qvector< int > intvec_t
vector of integers
Definition pro.h:2765
uint32 bgcolor_t
background color in RGB
Definition pro.h:5012
uint64 ea_t
Definition pro.h:421
THREAD_SAFE void qswap(T &a, T &b)
Swap 2 objects of the same type using memory copies.
Definition pro.h:1715
idaman size_t bufsize
Definition pro.h:600
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:381
_qstring< char > qstring
regular string
Definition pro.h:3694
bool operator!=(const TPointDouble &r) const
Definition graph.hpp:365
void sub(const TPointDouble &r)
Definition graph.hpp:349
TPointDouble()
Definition graph.hpp:341
void add(const TPointDouble &r)
Definition graph.hpp:344
void div(T d)
Definition graph.hpp:359
void negate(void)
Definition graph.hpp:354
double x
Definition graph.hpp:339
TPointDouble(const point_t &r)
Definition graph.hpp:343
TPointDouble(double a, double b)
Definition graph.hpp:342
double y
Definition graph.hpp:340
bool operator==(const TPointDouble &r) const
Definition graph.hpp:364
Attributes of a graph edge.
Definition graph.hpp:384
int width
edge width
Definition graph.hpp:386
int srcoff
source: edge port offset from the left
Definition graph.hpp:387
int dstoff
destination: edge port offset from the left
Definition graph.hpp:388
void idaapi add_layout_point(point_t p)
pointseq_t layout
describes geometry of edge
Definition graph.hpp:389
void idaapi reverse_layout(void)
Definition graph.hpp:391
bgcolor_t color
edge color
Definition graph.hpp:385
edge_infos_wrapper_t(const edge_infos_wrapper_t &other)
void clear()
Definition graph.hpp:1633
edge_infos_wrapper_t &idaapi operator=(const edge_infos_wrapper_t &other)
Definition graph.hpp:1627
edge_infos_t * ptr
Definition graph.hpp:792
~edge_infos_wrapper_t()
Definition graph.hpp:789
Edge layout point.
Definition graph.hpp:398
int pidx
index into edge_info_t::layout
Definition graph.hpp:399
edge_t e
parent edge
Definition graph.hpp:400
bool idaapi operator!=(const edge_layout_point_t &r) const
Definition graph.hpp:415
bool idaapi operator==(const edge_layout_point_t &r) const
Definition graph.hpp:411
idaapi edge_layout_point_t()
Definition graph.hpp:401
int idaapi compare(const edge_layout_point_t &r) const
Definition graph.hpp:403
idaapi edge_layout_point_t(const edge_t &_e, int _pidx)
Definition graph.hpp:402
Sub-segment of a graph edge.
Definition graph.hpp:490
edge_t e
Definition graph.hpp:491
bool idaapi toright() const
Definition graph.hpp:495
int nseg
Definition graph.hpp:492
size_t idaapi length() const
Definition graph.hpp:494
int x1
Definition graph.hpp:493
bool idaapi operator<(const edge_segment_t &r) const
Definition graph.hpp:496
int x0
Definition graph.hpp:493
Edge connecting two graph nodes.
Definition gdl.hpp:86
Path visitor - see drawable_graph_t::visit_paths()
Definition graph.hpp:150
virtual int idaapi walk_forward(int)
Definition graph.hpp:156
intvec_t path
current path
Definition graph.hpp:151
virtual ~graph_path_visitor_t()
Definition graph.hpp:159
bool prune
walk_forward(): prune := true means to stop the current path
Definition graph.hpp:152
virtual int idaapi walk_backward(int)
Definition graph.hpp:157
Definition graph.hpp:1370
intvec_t nodes
Definition graph.hpp:1371
qstring text
Definition graph.hpp:1372
int length(void) const
Definition graph.hpp:573
int x0
Definition graph.hpp:541
bool operator!=(const interval_t &r) const
Definition graph.hpp:576
bool contains(int x) const
Definition graph.hpp:574
interval_t(const edge_segment_t &s)
Definition graph.hpp:568
int x1
Definition graph.hpp:541
bool operator==(const interval_t &r) const
Definition graph.hpp:575
interval_t()
Definition graph.hpp:562
void intersect(const interval_t &r)
Definition graph.hpp:543
void move_by(int shift)
Definition graph.hpp:557
bool empty(void) const
Definition graph.hpp:542
interval_t(int y0, int y1)
Definition graph.hpp:563
void make_union(const interval_t &r)
Definition graph.hpp:550
Information about a node in a graph.
Definition graph.hpp:48
bgcolor_t frame_color
color of enclosing frame
Definition graph.hpp:53
bool valid_flags() const
Has valid flags?
Definition graph.hpp:68
qstring text
node contents
Definition graph.hpp:57
ea_t ea
address
Definition graph.hpp:56
uint32 flags
flags
Definition graph.hpp:55
bgcolor_t bg_color
background color
Definition graph.hpp:52
uint32 get_flags_for_valid() const
Get combination of Node info flags describing which attributes are valid.
Definition graph.hpp:71
bool valid_text() const
Has non-empty text?
Definition graph.hpp:66
bool valid_ea() const
Has valid ea?
Definition graph.hpp:64
bool valid_frame_color() const
Has valid frame_color?
Definition graph.hpp:62
bool valid_bg_color() const
Has valid bg_color?
Definition graph.hpp:60
Coordinate in a graph view.
Definition graph.hpp:165
point_t(const TPoint &p)
Definition graph.hpp:193
void div(T d)
Definition graph.hpp:182
point_t()
Definition graph.hpp:168
point_t & add(const point_t &r)
Definition graph.hpp:170
const char *idaapi dstr(void) const
int x
Definition graph.hpp:166
bool operator!=(const point_t &r) const
Definition graph.hpp:196
point_t(int _x, int _y)
Definition graph.hpp:169
void negate(void)
Definition graph.hpp:187
bool operator==(const point_t &r) const
Definition graph.hpp:195
size_t idaapi print(char *buf, size_t bufsize) const
int y
Definition graph.hpp:167
point_t & sub(const point_t &r)
Definition graph.hpp:176
Vector of range_t instances.
Definition range.hpp:93
A rectangle in a graph view.
Definition graph.hpp:224
int top
Definition graph.hpp:226
void verify(void)
Definition graph.hpp:236
rect_t(const TRect &r)
Definition graph.hpp:330
point_t center(void) const
Definition graph.hpp:258
int area(void) const
Definition graph.hpp:317
point_t topleft(void) const
Definition graph.hpp:262
int height(void) const
Definition graph.hpp:244
void intersect(const rect_t &r)
Definition graph.hpp:277
bool idaapi operator!=(const rect_t &r) const
Definition graph.hpp:325
void move_to(const point_t &p)
Definition graph.hpp:245
void make_union(const rect_t &r)
Definition graph.hpp:288
rect_t()
Definition graph.hpp:229
int left
Definition graph.hpp:225
const TRect & operator()(void) const
Definition graph.hpp:328
int width(void) const
Definition graph.hpp:243
void grow(int delta)
Definition graph.hpp:270
bool is_intersection_empty(const rect_t &r) const
Definition graph.hpp:303
bool idaapi operator==(const rect_t &r) const
Definition graph.hpp:318
bool idaapi operator<(const rect_t &r) const
rect_t(const point_t &p0, const point_t &p1)
Definition graph.hpp:231
point_t bottomright(void) const
Definition graph.hpp:266
TRect & operator()(void)
Definition graph.hpp:329
rect_t(int l, int t, int r, int b)
Definition graph.hpp:230
bool empty(void) const
Definition graph.hpp:299
int bottom
Definition graph.hpp:228
bool contains(const point_t &p) const
Definition graph.hpp:310
void move_by(const point_t &p)
Definition graph.hpp:251
int right
Definition graph.hpp:227
Organize graph nodes by row.
Definition graph.hpp:582
int height(void) const
Definition graph.hpp:587
int bottom
bottom y coord of the row
Definition graph.hpp:585
intvec_t nodes
list of nodes at the row
Definition graph.hpp:583
int top
top y coord of the row
Definition graph.hpp:584
void idaapi sub(const screen_graph_selection_t &s)
Definition graph.hpp:466
size_t idaapi items_count(bool look_for_nodes) const
Definition graph.hpp:478
size_t idaapi nodes_count() const
Definition graph.hpp:476
size_t idaapi points_count() const
Definition graph.hpp:477
void idaapi del_node(int node)
Definition graph.hpp:472
void idaapi del_point(edge_t e, int idx)
Definition graph.hpp:474
void idaapi add(const screen_graph_selection_t &s)
Definition graph.hpp:461
void idaapi add_node(int node)
Definition graph.hpp:471
bool idaapi has(const selection_item_t &item) const
Definition graph.hpp:459
void idaapi add_point(edge_t e, int idx)
Definition graph.hpp:473
Element of a graph selection - could be a node or edge layout point.
Definition graph.hpp:424
bool is_node
represents a selected node?
Definition graph.hpp:425
idaapi selection_item_t(class graph_item_t &)
idaapi selection_item_t(edge_t e, int idx)
Definition graph.hpp:432
bool idaapi operator<(const selection_item_t &r) const
Definition graph.hpp:447
edge_layout_point_t elp
edge layout point (is_node = false)
Definition graph.hpp:427
idaapi selection_item_t()
Definition graph.hpp:428
bool idaapi operator!=(const selection_item_t &r) const
Definition graph.hpp:445
idaapi selection_item_t(edge_layout_point_t &_elp)
Definition graph.hpp:430
bool idaapi operator==(const selection_item_t &r) const
Definition graph.hpp:443
int node
node number (is_node = true)
Definition graph.hpp:426
int idaapi compare(const selection_item_t &r) const
Definition graph.hpp:435
idaapi selection_item_t(int n)
Definition graph.hpp:429
Structure returned by get_custom_viewer_place() if the first parameter is a graph viewer.
Definition graph.hpp:1642
int node
Definition graph.hpp:1643