xref: /haiku/src/apps/icon-o-matic/generic/support/support_ui.h (revision 83b1a68c52ba3e0e8796282759f694b7fdddf06d)
1 /*
2  * Copyright 2006, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  */
8 
9 #ifndef SUPPORT_UI_H
10 #define SUPPORT_UI_H
11 
12 #include <GraphicsDefs.h>
13 #include <Rect.h>
14 #include <agg_math_stroke.h>
15 
16 class BBitmap;
17 class BDataIO;
18 class BMessage;
19 class BPositionIO;
20 class BString;
21 class BView;
22 class BWindow;
23 
24 // looper of view must be locked!
25 void stroke_frame(BView* view, BRect frame,
26 				  rgb_color left, rgb_color top,
27 				  rgb_color right, rgb_color bottom);
28 
29 
30 status_t store_color_in_message(BMessage* message, rgb_color color);
31 
32 status_t restore_color_from_message(const BMessage* message, rgb_color& color, int32 index = 0);
33 
34 BMessage make_color_drop_message(rgb_color color, BBitmap* bitmap);
35 
36 void make_sure_frame_is_on_screen(BRect& frame, BWindow* window);
37 
38 void print_modifiers();
39 
40 //agg::line_cap_e convert_cap_mode(uint32 mode);
41 //agg::line_join_e convert_join_mode(uint32 mode);
42 
43 const char* string_for_color_space(color_space format);
44 void print_color_space(color_space format);
45 
46 
47 // Those are already defined in newer versions of BeOS
48 #if !defined(B_BEOS_VERSION_DANO) && !defined(__HAIKU__)
49 
50 // rgb_color == rgb_color
51 static inline bool
52 operator==(const rgb_color& a, const rgb_color& b)
53 {
54 	return a.red == b.red
55 			&& a.green == b.green
56 			&& a.blue == b.blue
57 			&& a.alpha == b.alpha;
58 }
59 
60 // rgb_color != rgb_color
61 static inline bool
62 operator!=(const rgb_color& a, const rgb_color& b)
63 {
64 	return !(a == b);
65 }
66 
67 #endif // B_BEOS_VERSION <= ...
68 
69 #endif // SUPPORT_UI_H
70