This file is indexed.

/usr/share/doc/s3d/ch03s03.html is in s3d-doc 0.2.2-10.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>Data types</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><meta name="keywords" content="s3d, API, handbook, guide" /><link rel="home" href="index.html" title="S3D - a 3D Desktop Environment" /><link rel="up" href="ch03.html" title="Chapter&#160;3.&#160;libs3dw - The S3D Widget Library" /><link rel="prev" href="ch03s02.html" title="function reference" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Data types</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s02.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;3.&#160;libs3dw - The S3D Widget Library</th><td width="20%" align="right">&#160;</td></tr></table><hr /></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="data_types_s3dw"></a>Data types</h2></div></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="struct_s3dw_style"></a>struct _s3dw_style</h3></div></div></div><pre class="programlisting">struct <a class="link" href="ch03s03.html#struct_s3dw_style" title="struct _s3dw_style">_s3dw_style</a> {
	const char *name;
	const char *fontface;
	float surface_mat;
	float input_mat;
	float inputback_mat;
	float text_mat;
	float title_mat;
	float title_text_mat;
}</pre><p>With <a class="link" href="ch03s03.html#s3dw_style" title="typedef s3dw_style">s3dw_style</a> you can change the colors/materials of your widgets. materials are in the same as in <a class="link" href="ch02s02.html#s3d_push_materials_a" title="s3d_push_materials_a">s3d_push_materials_a</a>, that means red,green,blue and alpha float values (between 0.0 and 1.0) for ambience, specular and diffuse color.     </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">name</span></dt><dd><p>name of the style ... kind of redundant         </p></dd><dt><span class="term">fontface</span></dt><dd><p>font face for all used fonts         </p></dd><dt><span class="term">surface_mat</span></dt><dd><p>material for the surface background         </p></dd><dt><span class="term">input_mat</span></dt><dd><p>material for button boxes and other widgets         </p></dd><dt><span class="term">inputback_mat</span></dt><dd><p>material for input field background         </p></dd><dt><span class="term">text_mat</span></dt><dd><p>material for the text on buttons and inputs         </p></dd><dt><span class="term">title_mat</span></dt><dd><p>material for the title bar         </p></dd><dt><span class="term">title_text_mat</span></dt><dd><p>material for the text on the title bar         </p></dd></dl></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="struct_s3dw_widget"></a>struct _s3dw_widget</h3></div></div></div><pre class="programlisting">struct <a class="link" href="ch03s03.html#struct_s3dw_widget" title="struct _s3dw_widget">_s3dw_widget</a> {
	int type;
	s3dw_widget *parent;
	s3dw_style *style;
	int nobj;
	s3dw_widget **pobj;
	int focus;
	int flags;
	float ax;
	float ay;
	float az;
	float as;
	float arx;
	float ary;
	float arz;
	float width;
	float height;
	uint32_t oid;
	void *ptr;
	float x;
	float y;
	float z;
	float s;
	float rx;
	float ry;
	float rz;
}</pre><p>This is the most basic widget type, it contains all the "general" widget information. If you want to move a widget, you'd change x,y,z,s and rx,ry,rz and call <a class="link" href="ch03s02.html#s3dw_moveit" title="s3dw_moveit">s3dw_moveit</a> to turn your action reality. Every other widget has this type as first entry, so a simple typecast to <a class="link" href="ch03s03.html#s3dw_widget" title="typedef s3dw_widget">s3dw_widget</a> will give you the widgets "general" information. For typecast, you may use S3DWIDGET().</p><p>The pointer ptr allows linking to user-specific data structures. That comes in handy if the widget is called back by an event, and the program must now find out on which data the user reacted.     </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="struct_s3dw_button"></a>struct _s3dw_button</h3></div></div></div><pre class="programlisting">struct <a class="link" href="ch03s03.html#struct_s3dw_button" title="struct _s3dw_button">_s3dw_button</a> {
	s3dw_widget widget;
	char *text;
	uint32_t oid_text;
	s3dw_callback onclick;
}</pre><p>The buttons is just a button as you would expect it in a 2D widget library. It only reacts on clicks.     </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="struct_s3dw_label"></a>struct _s3dw_label</h3></div></div></div><pre class="programlisting">struct <a class="link" href="ch03s03.html#struct_s3dw_label" title="struct _s3dw_label">_s3dw_label</a> {
	s3dw_widget widget;
	char *text;
	s3dw_callback onclick;
}</pre><p>The labels is an label-field where a user may type things. onclick reacts on click in the field.     </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="struct_s3dw_scrollbar"></a>struct _s3dw_scrollbar</h3></div></div></div><pre class="programlisting">struct <a class="link" href="ch03s03.html#struct_s3dw_scrollbar" title="struct _s3dw_scrollbar">_s3dw_scrollbar</a> {
	s3dw_widget widget;
	float pos;
	float max;
	int type;
	int loid;
	int roid;
	int baroid;
	s3dw_callback lonclick;
	s3dw_callback ronclick;
}</pre><p>The Scrollbar should be placed around scrollable content. Currently only the left and right icons are clickable (lonclick and ronclick callbacks), in vertical mode lonclick is the callback for the up icon, ronclick the callback for the down icon.     </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="struct_s3dw_textbox"></a>struct _s3dw_textbox</h3></div></div></div><pre class="programlisting">struct <a class="link" href="ch03s03.html#struct_s3dw_textbox" title="struct _s3dw_textbox">_s3dw_textbox</a> {
	s3dw_widget widget;
	s3dw_scrollbar *scroll_vertical;
	s3dw_scrollbar *scroll_horizontal;
	char *text;
	int n_lineoids;
	int *p_lineoids;
	int window_x;
	int window_y;
	s3dw_callback onclick;
}</pre><p>A textbox shows some text with scrollbars to scroll around. It can currently only react to a click event.     </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="struct_s3dw_input"></a>struct _s3dw_input</h3></div></div></div><pre class="programlisting">struct <a class="link" href="ch03s03.html#struct_s3dw_input" title="struct _s3dw_input">_s3dw_input</a> {
	s3dw_widget widget;
	char *text;
	uint32_t oid_text;
	s3dw_callback onclick;
	s3dw_callback onedit;
}</pre><p>The inputs is an input-field where a user may type things. onclick reacts on click in the field, onedit notifies you when someone writes in the field.     </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="struct_s3dw_surface"></a>struct _s3dw_surface</h3></div></div></div><pre class="programlisting">struct <a class="link" href="ch03s03.html#struct_s3dw_surface" title="struct _s3dw_surface">_s3dw_surface</a> {
	s3dw_widget widget;
	uint32_t oid_title;
	uint32_t oid_tbar;
	char *title;
}</pre><p>A surface is the window of this widget library, holding all of our elements like buttons, input fields etc ...     </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3dw_widget"></a>typedef s3dw_widget</h3></div></div></div><pre class="programlisting">typedef struct <a class="link" href="ch03s03.html#struct_s3dw_widget" title="struct _s3dw_widget">_s3dw_widget</a> <a class="link" href="ch03s03.html#s3dw_widget" title="typedef s3dw_widget">s3dw_widget</a></pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3dw_button"></a>typedef s3dw_button</h3></div></div></div><pre class="programlisting">typedef struct <a class="link" href="ch03s03.html#struct_s3dw_button" title="struct _s3dw_button">_s3dw_button</a> <a class="link" href="ch03s03.html#s3dw_button" title="typedef s3dw_button">s3dw_button</a></pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3dw_label"></a>typedef s3dw_label</h3></div></div></div><pre class="programlisting">typedef struct <a class="link" href="ch03s03.html#struct_s3dw_label" title="struct _s3dw_label">_s3dw_label</a> <a class="link" href="ch03s03.html#s3dw_label" title="typedef s3dw_label">s3dw_label</a></pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3dw_textbox"></a>typedef s3dw_textbox</h3></div></div></div><pre class="programlisting">typedef struct <a class="link" href="ch03s03.html#struct_s3dw_textbox" title="struct _s3dw_textbox">_s3dw_textbox</a> <a class="link" href="ch03s03.html#s3dw_textbox" title="typedef s3dw_textbox">s3dw_textbox</a></pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3dw_scrollbar"></a>typedef s3dw_scrollbar</h3></div></div></div><pre class="programlisting">typedef struct <a class="link" href="ch03s03.html#struct_s3dw_scrollbar" title="struct _s3dw_scrollbar">_s3dw_scrollbar</a> <a class="link" href="ch03s03.html#s3dw_scrollbar" title="typedef s3dw_scrollbar">s3dw_scrollbar</a></pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3dw_input"></a>typedef s3dw_input</h3></div></div></div><pre class="programlisting">typedef struct <a class="link" href="ch03s03.html#struct_s3dw_input" title="struct _s3dw_input">_s3dw_input</a> <a class="link" href="ch03s03.html#s3dw_input" title="typedef s3dw_input">s3dw_input</a></pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3dw_surface"></a>typedef s3dw_surface</h3></div></div></div><pre class="programlisting">typedef struct <a class="link" href="ch03s03.html#struct_s3dw_surface" title="struct _s3dw_surface">_s3dw_surface</a> <a class="link" href="ch03s03.html#s3dw_surface" title="typedef s3dw_surface">s3dw_surface</a></pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3dw_style"></a>typedef s3dw_style</h3></div></div></div><pre class="programlisting">typedef struct <a class="link" href="ch03s03.html#struct_s3dw_style" title="struct _s3dw_style">_s3dw_style</a> <a class="link" href="ch03s03.html#s3dw_style" title="typedef s3dw_style">s3dw_style</a></pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="s3dw_callback"></a>typedef s3dw_callback</h3></div></div></div><pre class="programlisting">typedef void(* <a class="link" href="ch03s03.html#s3dw_callback" title="typedef s3dw_callback">s3dw_callback</a>)(<a class="link" href="ch03s03.html#s3dw_widget" title="typedef s3dw_widget">s3dw_widget</a> *)</pre><p>The callback type. Receive the widget which is affected as argument.</p><pre class="programlisting"> // example
 void my_handler(<a class="link" href="ch03s03.html#s3dw_widget" title="typedef s3dw_widget">s3dw_widget</a> *widget)
 {
         // do something with the widget
         ...
 }
</pre></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s02.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right">&#160;</td></tr><tr><td width="40%" align="left" valign="top">function reference&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;</td></tr></table></div></body></html>