/[svn]/gigedit/trunk/src/gigedit/gfx/builtinpix.cpp
ViewVC logotype

Contents of /gigedit/trunk/src/gigedit/gfx/builtinpix.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3131 - (show annotations) (download)
Thu Apr 27 17:28:01 2017 UTC (6 years, 11 months ago) by schoenebeck
File size: 1428 byte(s)
* Color tweaking on selected regions and selected dimension zones.
* Dimension Region Chooser: Show main selected case in opaque blue color
  (like before), but all other selected dimension zones with a blue hatched
  pattern instead.
* Dimension Region Chooser: Show the label of the currently selected
  dimension in bold font.
* Fix: Keyboard accelerator Ctrl+Left and Ctrl+Right caused the current
  dimension zone to switch as well if Dimension Region Chooser got focus.

1 #include "builtinpix.h"
2
3 Glib::RefPtr<Gdk::Pixbuf> redDot;
4 Glib::RefPtr<Gdk::Pixbuf> yellowDot;
5 Glib::RefPtr<Gdk::Pixbuf> blackLoop;
6 Glib::RefPtr<Gdk::Pixbuf> blueHatchedPattern;
7 Glib::RefPtr<Gdk::Pixbuf> grayLoop;
8
9 extern const unsigned char red_dot_rgba[];
10 extern const unsigned char yellow_dot_rgba[];
11 extern const unsigned char black_loop_rgba[];
12 extern const unsigned char blue_hatched_pattern_rgba[];
13 extern const unsigned char gray_loop_rgba[];
14
15 extern const int red_dot_rgba_size;
16 extern const int yellow_dot_rgba_size;
17 extern const int black_loop_rgba_size;
18 extern const int blue_hatched_pattern_rgba_size;
19 extern const int gray_loop_rgba_size;
20
21 static struct _BuiltInPixMap {
22 Glib::RefPtr<Gdk::Pixbuf>* pixbuf;
23 const unsigned char* raw;
24 int size;
25 } builtInPixMap[] = {
26 { &redDot, red_dot_rgba, red_dot_rgba_size },
27 { &yellowDot, yellow_dot_rgba, yellow_dot_rgba_size },
28 { &blackLoop, black_loop_rgba, black_loop_rgba_size },
29 { &blueHatchedPattern, blue_hatched_pattern_rgba, blue_hatched_pattern_rgba_size },
30 { &grayLoop, gray_loop_rgba, gray_loop_rgba_size },
31 };
32
33 void loadBuiltInPix() {
34 if (*builtInPixMap[0].pixbuf) return;
35 const int n = sizeof(builtInPixMap) / sizeof(_BuiltInPixMap);
36 for (int i = 0; i < n; ++i) {
37 *builtInPixMap[i].pixbuf = Gdk::Pixbuf::create_from_inline(
38 builtInPixMap[i].size,
39 builtInPixMap[i].raw
40 );
41 }
42 }

  ViewVC Help
Powered by ViewVC