7cb02901 |
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> |
2 | <HTML |
3 | ><HEAD |
4 | ><TITLE |
5 | >The static part of a module</TITLE |
6 | ><META |
7 | NAME="GENERATOR" |
8 | CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK |
9 | REL="HOME" |
10 | TITLE="Linux Trace Toolkit Viewer Developer Guide" |
11 | HREF="index.html"><LINK |
12 | REL="UP" |
13 | TITLE="Linux Trace Toolkit Viewer Graphical Module Tutorial" |
14 | HREF="c67.html"><LINK |
15 | REL="PREVIOUS" |
16 | TITLE="Linux Trace Toolkit Viewer Graphical Module Tutorial" |
17 | HREF="c67.html"><LINK |
18 | REL="NEXT" |
19 | TITLE="The dynamic part of a module : the viewer" |
20 | HREF="x77.html"></HEAD |
21 | ><BODY |
22 | CLASS="sect1" |
23 | BGCOLOR="#FFFFFF" |
24 | TEXT="#000000" |
25 | LINK="#0000FF" |
26 | VLINK="#840084" |
27 | ALINK="#0000FF" |
28 | ><DIV |
29 | CLASS="NAVHEADER" |
30 | ><TABLE |
31 | SUMMARY="Header navigation table" |
32 | WIDTH="100%" |
33 | BORDER="0" |
34 | CELLPADDING="0" |
35 | CELLSPACING="0" |
36 | ><TR |
37 | ><TH |
38 | COLSPAN="3" |
39 | ALIGN="center" |
40 | >Linux Trace Toolkit Viewer Developer Guide</TH |
41 | ></TR |
42 | ><TR |
43 | ><TD |
44 | WIDTH="10%" |
45 | ALIGN="left" |
46 | VALIGN="bottom" |
47 | ><A |
48 | HREF="c67.html" |
49 | ACCESSKEY="P" |
50 | >Prev</A |
51 | ></TD |
52 | ><TD |
53 | WIDTH="80%" |
54 | ALIGN="center" |
55 | VALIGN="bottom" |
56 | >Chapter 3. Linux Trace Toolkit Viewer Graphical Module Tutorial</TD |
57 | ><TD |
58 | WIDTH="10%" |
59 | ALIGN="right" |
60 | VALIGN="bottom" |
61 | ><A |
62 | HREF="x77.html" |
63 | ACCESSKEY="N" |
64 | >Next</A |
65 | ></TD |
66 | ></TR |
67 | ></TABLE |
68 | ><HR |
69 | ALIGN="LEFT" |
70 | WIDTH="100%"></DIV |
71 | ><DIV |
72 | CLASS="sect1" |
73 | ><H1 |
74 | CLASS="sect1" |
75 | ><A |
76 | NAME="AEN72" |
77 | >3.2. The static part of a module</A |
78 | ></H1 |
79 | ><P |
80 | > A module must have a static part to be able to get loaded just like a text |
81 | module. Now, let's see the differences. The graphical module depends on the |
82 | "lttvwindow" module. See module.c from the control flow viewer for an example. |
83 | </P |
84 | ><P |
85 | > The init() and destroy() functions must register functions that can be called by |
86 | user interaction to instanciate the viewers. That's the goal of |
87 | lttvwindow_register_constructor() and lttvwindow_unregister_constructor() : |
88 | they register a function with a menu entry and an icon. The main window will |
89 | shown them in its interface and call the function when the button or menu item |
90 | is selected. This hook function must receive a pointer to a "Tab" object in |
91 | parameter. |
92 | </P |
93 | ><P |
94 | > Also note the presence of the destroy_walk() method. It is called when the |
95 | module is unloaded : it must destroy all the instances of the viewers from the |
96 | module. |
97 | </P |
98 | ></DIV |
99 | ><DIV |
100 | CLASS="NAVFOOTER" |
101 | ><HR |
102 | ALIGN="LEFT" |
103 | WIDTH="100%"><TABLE |
104 | SUMMARY="Footer navigation table" |
105 | WIDTH="100%" |
106 | BORDER="0" |
107 | CELLPADDING="0" |
108 | CELLSPACING="0" |
109 | ><TR |
110 | ><TD |
111 | WIDTH="33%" |
112 | ALIGN="left" |
113 | VALIGN="top" |
114 | ><A |
115 | HREF="c67.html" |
116 | ACCESSKEY="P" |
117 | >Prev</A |
118 | ></TD |
119 | ><TD |
120 | WIDTH="34%" |
121 | ALIGN="center" |
122 | VALIGN="top" |
123 | ><A |
124 | HREF="index.html" |
125 | ACCESSKEY="H" |
126 | >Home</A |
127 | ></TD |
128 | ><TD |
129 | WIDTH="33%" |
130 | ALIGN="right" |
131 | VALIGN="top" |
132 | ><A |
133 | HREF="x77.html" |
134 | ACCESSKEY="N" |
135 | >Next</A |
136 | ></TD |
137 | ></TR |
138 | ><TR |
139 | ><TD |
140 | WIDTH="33%" |
141 | ALIGN="left" |
142 | VALIGN="top" |
143 | >Linux Trace Toolkit Viewer Graphical Module Tutorial</TD |
144 | ><TD |
145 | WIDTH="34%" |
146 | ALIGN="center" |
147 | VALIGN="top" |
148 | ><A |
149 | HREF="c67.html" |
150 | ACCESSKEY="U" |
151 | >Up</A |
152 | ></TD |
153 | ><TD |
154 | WIDTH="33%" |
155 | ALIGN="right" |
156 | VALIGN="top" |
157 | >The dynamic part of a module : the viewer</TD |
158 | ></TR |
159 | ></TABLE |
160 | ></DIV |
161 | ></BODY |
162 | ></HTML |
163 | > |