diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/llui/llui.h | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/llui/llui.h')
-rw-r--r-- | linden/indra/llui/llui.h | 274 |
1 files changed, 274 insertions, 0 deletions
diff --git a/linden/indra/llui/llui.h b/linden/indra/llui/llui.h new file mode 100644 index 0000000..cd57990 --- /dev/null +++ b/linden/indra/llui/llui.h | |||
@@ -0,0 +1,274 @@ | |||
1 | /** | ||
2 | * @file llui.h | ||
3 | * @brief UI implementation | ||
4 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | // All immediate-mode gl drawing should happen here. | ||
29 | |||
30 | #ifndef LL_LLUI_H | ||
31 | #define LL_LLUI_H | ||
32 | |||
33 | #include "llrect.h" | ||
34 | #include "llcontrol.h" | ||
35 | #include "llrect.h" | ||
36 | #include "llcoord.h" | ||
37 | |||
38 | class LLColor4; | ||
39 | class LLVector3; | ||
40 | class LLVector2; | ||
41 | class LLImageGL; | ||
42 | class LLUUID; | ||
43 | class LLWindow; | ||
44 | class LLView; | ||
45 | |||
46 | // UI colors | ||
47 | extern const LLColor4 UI_VERTEX_COLOR; | ||
48 | void make_ui_sound(const LLString& name); | ||
49 | |||
50 | BOOL ui_point_in_rect(S32 x, S32 y, S32 left, S32 top, S32 right, S32 bottom); | ||
51 | void gl_state_for_2d(S32 width, S32 height); | ||
52 | |||
53 | void gl_line_2d(S32 x1, S32 y1, S32 x2, S32 y2); | ||
54 | void gl_line_2d(S32 x1, S32 y1, S32 x2, S32 y2, const LLColor4 &color ); | ||
55 | void gl_triangle_2d(S32 x1, S32 y1, S32 x2, S32 y2, S32 x3, S32 y3, const LLColor4& color, BOOL filled); | ||
56 | void gl_rect_2d_simple( S32 width, S32 height ); | ||
57 | |||
58 | void gl_draw_x(const LLRect& rect, const LLColor4& color); | ||
59 | |||
60 | void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled = TRUE ); | ||
61 | void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &color, BOOL filled = TRUE ); | ||
62 | void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &color, S32 pixel_offset = 0, BOOL filled = TRUE ); | ||
63 | void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, S32 pixel_offset = 0, BOOL filled = TRUE ); | ||
64 | void gl_rect_2d(const LLRect& rect, BOOL filled = TRUE ); | ||
65 | void gl_rect_2d(const LLRect& rect, const LLColor4& color, BOOL filled = TRUE ); | ||
66 | void gl_rect_2d_checkerboard(const LLRect& rect); | ||
67 | |||
68 | void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &start_color, S32 lines); | ||
69 | |||
70 | void gl_circle_2d(F32 x, F32 y, F32 radius, S32 steps, BOOL filled); | ||
71 | void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled, F32 start_angle, F32 end_angle); | ||
72 | void gl_deep_circle( F32 radius, F32 depth ); | ||
73 | void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor4& side_color, S32 steps, BOOL render_center ); | ||
74 | void gl_corners_2d(S32 left, S32 top, S32 right, S32 bottom, S32 length, F32 max_frac); | ||
75 | void gl_washer_2d(F32 outer_radius, F32 inner_radius, S32 steps, const LLColor4& inner_color, const LLColor4& outer_color); | ||
76 | void gl_washer_segment_2d(F32 outer_radius, F32 inner_radius, F32 start_radians, F32 end_radians, S32 steps, const LLColor4& inner_color, const LLColor4& outer_color); | ||
77 | void gl_washer_spokes_2d(F32 outer_radius, F32 inner_radius, S32 count, const LLColor4& inner_color, const LLColor4& outer_color); | ||
78 | |||
79 | void gl_draw_image(S32 x, S32 y, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR); | ||
80 | void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR); | ||
81 | void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR); | ||
82 | void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees,LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR); | ||
83 | void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLImageGL* image, const LLColor4 &color, BOOL solid_color = FALSE); | ||
84 | // Flip vertical, used for LLFloaterHTML | ||
85 | void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR); | ||
86 | |||
87 | void gl_rect_2d_xor(S32 left, S32 top, S32 right, S32 bottom); | ||
88 | void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase = 0.f ); | ||
89 | |||
90 | void gl_rect_2d_simple_tex( S32 width, S32 height ); | ||
91 | |||
92 | // segmented rectangles | ||
93 | |||
94 | /* | ||
95 | TL |______TOP_________| TR | ||
96 | /| |\ | ||
97 | _/_|__________________|_\_ | ||
98 | L| | MIDDLE | |R | ||
99 | _|_|__________________|_|_ | ||
100 | \ | BOTTOM | / | ||
101 | BL\|__________________|/ BR | ||
102 | | | | ||
103 | */ | ||
104 | |||
105 | typedef enum e_rounded_edge | ||
106 | { | ||
107 | ROUNDED_RECT_LEFT = 0x1, | ||
108 | ROUNDED_RECT_TOP = 0x2, | ||
109 | ROUNDED_RECT_RIGHT = 0x4, | ||
110 | ROUNDED_RECT_BOTTOM = 0x8, | ||
111 | ROUNDED_RECT_ALL = 0xf | ||
112 | }ERoundedEdge; | ||
113 | |||
114 | |||
115 | void gl_segmented_rect_2d_tex(const S32 left, const S32 top, const S32 right, const S32 bottom, const S32 texture_width, const S32 texture_height, const S32 border_size, const U32 edges = ROUNDED_RECT_ALL); | ||
116 | void gl_segmented_rect_2d_fragment_tex(const S32 left, const S32 top, const S32 right, const S32 bottom, const S32 texture_width, const S32 texture_height, const S32 border_size, const F32 start_fragment, const F32 end_fragment, const U32 edges = ROUNDED_RECT_ALL); | ||
117 | void gl_segmented_rect_3d_tex(const LLVector2& border_scale, const LLVector3& border_width, const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec, U32 edges = ROUNDED_RECT_ALL); | ||
118 | void gl_segmented_rect_3d_tex_top(const LLVector2& border_scale, const LLVector3& border_width, const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec); | ||
119 | |||
120 | inline void gl_rect_2d( const LLRect& rect, BOOL filled ) | ||
121 | { | ||
122 | gl_rect_2d( rect.mLeft, rect.mTop, rect.mRight, rect.mBottom, filled ); | ||
123 | } | ||
124 | |||
125 | inline void gl_rect_2d_offset_local( const LLRect& rect, S32 pixel_offset, BOOL filled) | ||
126 | { | ||
127 | gl_rect_2d_offset_local( rect.mLeft, rect.mTop, rect.mRight, rect.mBottom, pixel_offset, filled ); | ||
128 | } | ||
129 | |||
130 | // No longer used | ||
131 | // Initializes translation table | ||
132 | // void init_tr(); | ||
133 | |||
134 | // Returns a string from the string table in the correct language | ||
135 | // LLString tr(const LLString& english_chars); | ||
136 | |||
137 | // Used to hide the flashing text cursor when window doesn't have focus. | ||
138 | extern BOOL gShowTextEditCursor; | ||
139 | |||
140 | // Language | ||
141 | extern LLString gLanguage; | ||
142 | |||
143 | class LLImageProviderInterface; | ||
144 | typedef void (*LLUIAudioCallback)(const LLUUID& uuid, F32 volume); | ||
145 | |||
146 | class LLUI | ||
147 | { | ||
148 | public: | ||
149 | static void initClass(LLControlGroup* config, | ||
150 | LLControlGroup* colors, | ||
151 | LLControlGroup* assets, | ||
152 | LLImageProviderInterface* image_provider, | ||
153 | LLUIAudioCallback audio_callback = NULL, | ||
154 | const LLVector2 *scale_factor = NULL, | ||
155 | const LLString& language = LLString::null); | ||
156 | static void cleanupClass(); | ||
157 | |||
158 | static void pushMatrix(); | ||
159 | static void popMatrix(); | ||
160 | static void loadIdentity(); | ||
161 | static void translate(F32 x, F32 y, F32 z = 0.0f); | ||
162 | |||
163 | //helper functions (should probably move free standing rendering helper functions here) | ||
164 | static LLString locateSkin(const LLString& filename); | ||
165 | static void setScissorRegionScreen(const LLRect& rect); | ||
166 | static void setScissorRegionLocal(const LLRect& rect); // works assuming LLUI::translate has been called | ||
167 | static void setCursorPositionScreen(S32 x, S32 y); | ||
168 | static void setCursorPositionLocal(LLView* viewp, S32 x, S32 y); | ||
169 | static void setScaleFactor(const LLVector2& scale_factor); | ||
170 | static void setLineWidth(F32 width); | ||
171 | static LLUUID findAssetUUIDByName(const LLString& name); | ||
172 | static LLVector2 getWindowSize(); | ||
173 | public: | ||
174 | static LLControlGroup* sConfigGroup; | ||
175 | static LLControlGroup* sColorsGroup; | ||
176 | static LLControlGroup* sAssetsGroup; | ||
177 | static LLImageProviderInterface* sImageProvider; | ||
178 | static LLUIAudioCallback sAudioCallback; | ||
179 | static LLVector2 sGLScaleFactor; | ||
180 | static LLWindow* sWindow; | ||
181 | static BOOL sShowXUINames; | ||
182 | }; | ||
183 | |||
184 | // UI widgets | ||
185 | // This MUST match UICtrlNames in lluictrlfactory.cpp | ||
186 | typedef enum e_widget_type | ||
187 | { | ||
188 | WIDGET_TYPE_VIEW = 0, | ||
189 | WIDGET_TYPE_ROOT_VIEW, | ||
190 | WIDGET_TYPE_FLOATER_VIEW, | ||
191 | WIDGET_TYPE_BUTTON, | ||
192 | WIDGET_TYPE_JOYSTICK_TURN, | ||
193 | WIDGET_TYPE_JOYSTICK_SLIDE, | ||
194 | WIDGET_TYPE_CHECKBOX, | ||
195 | WIDGET_TYPE_COLOR_SWATCH, | ||
196 | WIDGET_TYPE_COMBO_BOX, | ||
197 | WIDGET_TYPE_LINE_EDITOR, | ||
198 | WIDGET_TYPE_SEARCH_EDITOR, | ||
199 | WIDGET_TYPE_SCROLL_LIST, | ||
200 | WIDGET_TYPE_NAME_LIST, | ||
201 | WIDGET_TYPE_WEBBROWSER, | ||
202 | WIDGET_TYPE_SLIDER, // actually LLSliderCtrl | ||
203 | WIDGET_TYPE_SLIDER_BAR, // actually LLSlider | ||
204 | WIDGET_TYPE_VOLUME_SLIDER,//actually LLVolumeSliderCtrl | ||
205 | WIDGET_TYPE_SPINNER, | ||
206 | WIDGET_TYPE_TEXT_EDITOR, | ||
207 | WIDGET_TYPE_TEXTURE_PICKER, | ||
208 | WIDGET_TYPE_TEXT_BOX, | ||
209 | WIDGET_TYPE_PAD, // used in XML for positioning, not a real widget | ||
210 | WIDGET_TYPE_RADIO_GROUP, | ||
211 | WIDGET_TYPE_ICON, | ||
212 | WIDGET_TYPE_LOCATE, // used in XML for positioning, not a real widget | ||
213 | WIDGET_TYPE_VIEW_BORDER, // decorative border | ||
214 | WIDGET_TYPE_PANEL, | ||
215 | WIDGET_TYPE_MENU, | ||
216 | WIDGET_TYPE_PIE_MENU, | ||
217 | WIDGET_TYPE_PIE_MENU_BRANCH, | ||
218 | WIDGET_TYPE_MENU_ITEM, | ||
219 | WIDGET_TYPE_MENU_ITEM_SEPARATOR, | ||
220 | WIDGET_TYPE_MENU_SEPARATOR_VERTICAL, | ||
221 | WIDGET_TYPE_MENU_ITEM_CALL, | ||
222 | WIDGET_TYPE_MENU_ITEM_CHECK, | ||
223 | WIDGET_TYPE_MENU_ITEM_BRANCH, | ||
224 | WIDGET_TYPE_MENU_ITEM_BRANCH_DOWN, | ||
225 | WIDGET_TYPE_MENU_ITEM_BLANK, | ||
226 | WIDGET_TYPE_TEAROFF_MENU, | ||
227 | WIDGET_TYPE_MENU_BAR, | ||
228 | WIDGET_TYPE_TAB_CONTAINER, | ||
229 | WIDGET_TYPE_SCROLL_CONTAINER, // LLScrollableContainerView | ||
230 | WIDGET_TYPE_SCROLLBAR, | ||
231 | WIDGET_TYPE_INVENTORY_PANEL, // LLInventoryPanel | ||
232 | WIDGET_TYPE_FLOATER, | ||
233 | WIDGET_TYPE_DRAG_HANDLE_TOP, | ||
234 | WIDGET_TYPE_DRAG_HANDLE_LEFT, | ||
235 | WIDGET_TYPE_RESIZE_HANDLE, | ||
236 | WIDGET_TYPE_RESIZE_BAR, | ||
237 | WIDGET_TYPE_NAME_EDITOR, | ||
238 | WIDGET_TYPE_MULTI_FLOATER, | ||
239 | WIDGET_TYPE_MEDIA_REMOTE, | ||
240 | WIDGET_TYPE_FOLDER_VIEW, | ||
241 | WIDGET_TYPE_FOLDER_ITEM, | ||
242 | WIDGET_TYPE_FOLDER, | ||
243 | WIDGET_TYPE_STAT_GRAPH, | ||
244 | WIDGET_TYPE_STAT_VIEW, | ||
245 | WIDGET_TYPE_STAT_BAR, | ||
246 | WIDGET_TYPE_DROP_TARGET, | ||
247 | WIDGET_TYPE_TEXTURE_BAR, | ||
248 | WIDGET_TYPE_TEX_MEM_BAR, | ||
249 | WIDGET_TYPE_SNAPSHOT_LIVE_PREVIEW, | ||
250 | WIDGET_TYPE_STATUS_BAR, | ||
251 | WIDGET_TYPE_PROGRESS_VIEW, | ||
252 | WIDGET_TYPE_TALK_VIEW, | ||
253 | WIDGET_TYPE_OVERLAY_BAR, | ||
254 | WIDGET_TYPE_HUD_VIEW, | ||
255 | WIDGET_TYPE_HOVER_VIEW, | ||
256 | WIDGET_TYPE_MORPH_VIEW, | ||
257 | WIDGET_TYPE_NET_MAP, | ||
258 | WIDGET_TYPE_PERMISSIONS_VIEW, | ||
259 | WIDGET_TYPE_MENU_HOLDER, | ||
260 | WIDGET_TYPE_DEBUG_VIEW, | ||
261 | WIDGET_TYPE_SCROLLING_PANEL_LIST, | ||
262 | WIDGET_TYPE_AUDIO_STATUS, | ||
263 | WIDGET_TYPE_CONTAINER_VIEW, | ||
264 | WIDGET_TYPE_CONSOLE, | ||
265 | WIDGET_TYPE_FAST_TIMER_VIEW, | ||
266 | WIDGET_TYPE_VELOCITY_BAR, | ||
267 | WIDGET_TYPE_TEXTURE_VIEW, | ||
268 | WIDGET_TYPE_MEMORY_VIEW, | ||
269 | WIDGET_TYPE_FRAME_STAT_VIEW, | ||
270 | WIDGET_TYPE_DONTCARE, | ||
271 | WIDGET_TYPE_COUNT | ||
272 | } EWidgetType; | ||
273 | |||
274 | #endif | ||