- Add first draft of a widget to show the state of a schedulable
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@915 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
8965985510
commit
23adb864c2
|
@ -299,6 +299,7 @@ sgpemv2_SOURCES = \
|
||||||
src/gui_builder.cc \
|
src/gui_builder.cc \
|
||||||
src/main.cc \
|
src/main.cc \
|
||||||
src/parse_opts.cc \
|
src/parse_opts.cc \
|
||||||
|
src/schedulable_state_widget.cc \
|
||||||
src/schedulables_tree_widget.cc \
|
src/schedulables_tree_widget.cc \
|
||||||
src/simulation_widget.cc \
|
src/simulation_widget.cc \
|
||||||
src/text_simulation.cc
|
src/text_simulation.cc
|
||||||
|
@ -311,6 +312,7 @@ noinst_HEADERS += \
|
||||||
src/gui_builder.hh \
|
src/gui_builder.hh \
|
||||||
src/main.hh \
|
src/main.hh \
|
||||||
src/parse_opts.hh \
|
src/parse_opts.hh \
|
||||||
|
src/schedulable_state_widget.hh \
|
||||||
src/schedulables_tree_widget.hh \
|
src/schedulables_tree_widget.hh \
|
||||||
src/simulation_widget.hh \
|
src/simulation_widget.hh \
|
||||||
src/text_simulation.hh
|
src/text_simulation.hh
|
||||||
|
|
|
@ -33,12 +33,16 @@ namespace sgpem
|
||||||
|
|
||||||
struct Point
|
struct Point
|
||||||
{
|
{
|
||||||
|
Point(float X, float Y)
|
||||||
|
: x(X), y(Y) {}
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Rectangle
|
struct Rectangle
|
||||||
{
|
{
|
||||||
|
Rectangle(float X0, float Y0, float W, float H)
|
||||||
|
: x0(X0), y0(Y0), w(W), h(H) {}
|
||||||
float x0;
|
float x0;
|
||||||
float y0;
|
float y0;
|
||||||
float w;
|
float w;
|
||||||
|
@ -47,6 +51,8 @@ namespace sgpem
|
||||||
|
|
||||||
struct Color
|
struct Color
|
||||||
{
|
{
|
||||||
|
Color(float R, float G, float B)
|
||||||
|
: r(R), g(G), b(B) {}
|
||||||
float r;
|
float r;
|
||||||
float g;
|
float g;
|
||||||
float b;
|
float b;
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <cairo.h>
|
#include <cairo.h>
|
||||||
#include <gtkmm/drawingarea.h>
|
|
||||||
#include <gtkmm/widget.h>
|
#include <gtkmm/widget.h>
|
||||||
#include <gdkmm/pixmap.h>
|
#include <gdkmm/pixmap.h>
|
||||||
|
|
||||||
|
|
|
@ -103,18 +103,18 @@ TestWidget::draw_widget(cairo_t* ctx)
|
||||||
// NOTE: just to try
|
// NOTE: just to try
|
||||||
CairoElements ce(ctx);
|
CairoElements ce(ctx);
|
||||||
|
|
||||||
Rectangle area = { 10, 10, _desired_w-10, _desired_h/2 };
|
Rectangle area(10, 10, _desired_w-10, _desired_h/2);
|
||||||
ce.draw_container(area);
|
ce.draw_container(area);
|
||||||
Color red = { 1, 0, 0 };
|
Color red(1, 0, 0 );
|
||||||
Point center1 = { _desired_w/4, _desired_h/4*3 };
|
Point center1(_desired_w/4, _desired_h/4*3);
|
||||||
ce.draw_3dsphere(center1, _desired_w/10, red);
|
ce.draw_3dsphere(center1, _desired_w/10, red);
|
||||||
|
|
||||||
Color yellow = { 1, 1, 0 };
|
Color yellow(1, 1, 0);
|
||||||
Point center2 = { _desired_w/4*2, _desired_h/4*3 };
|
Point center2(_desired_w/4*2, _desired_h/4*3);
|
||||||
ce.draw_3dsphere(center2, _desired_w/10, yellow);
|
ce.draw_3dsphere(center2, _desired_w/10, yellow);
|
||||||
|
|
||||||
Color green = { 0, 1, 0 };
|
Color green(0, 1, 0);
|
||||||
Point center3 = { _desired_w/4*3, _desired_h/4*3 };
|
Point center3(_desired_w/4*3, _desired_h/4*3);
|
||||||
ce.draw_3dsphere(center3, _desired_w/10, green);
|
ce.draw_3dsphere(center3, _desired_w/10, green);
|
||||||
|
|
||||||
// show text
|
// show text
|
||||||
|
|
Loading…
Reference in New Issue