[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Adonthell-commits] CVS: adonthell/src/tools/dlgedit dlg_circle.cc,1.9,
From: |
Kai Sterker <address@hidden> |
Subject: |
[Adonthell-commits] CVS: adonthell/src/tools/dlgedit dlg_circle.cc,1.9,1.10 dlg_types.h,1.8,1.9 gui_resources.cc,1.2,1.3gui_resources.h,1.1,1.2 |
Date: |
Fri, 10 Jan 2003 15:22:52 -0500 |
Update of /cvsroot/adonthell/adonthell/src/tools/dlgedit
In directory subversions:/tmp/cvs-serv18494
Modified Files:
dlg_circle.cc dlg_types.h gui_resources.cc gui_resources.h
Log Message:
IMPROVED contrast of circle nodes. Thanks Sasha!
Index: dlg_circle.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_circle.cc,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** dlg_circle.cc 9 Nov 2002 21:47:02 -0000 1.9
--- dlg_circle.cc 10 Jan 2003 20:22:49 -0000 1.10
***************
*** 79,84 ****
void DlgCircle::draw (GdkPixmap *surface, DlgPoint &os, GtkWidget *widget)
{
! // get the color for drawing the circle
! GdkGC *gc = GuiResources::getColor (mode_, type_);
// offset circle
--- 79,85 ----
void DlgCircle::draw (GdkPixmap *surface, DlgPoint &os, GtkWidget *widget)
{
! // get the color and fill for drawing the circle
! GdkGC *gc = GuiResources::getColor (mode_, type_);
! GdkGC *fgc = GuiResources::getFill (mode_, type_);
// offset circle
***************
*** 86,93 ****
DlgRect area (position, width () + 1, height () + 1);
! // draw everything to the surface
! gdk_draw_arc (surface, GuiResources::getColor (GC_WHITE), TRUE,
position.x (), position.y (), 20, 20, 0, 36000);
! gdk_draw_arc (surface, gc, FALSE, position.x (), position.y (), 20, 20,
0, 36000);
!
// Indicate whether node contains additional code
if (hasCode () || entry_->loop ())
--- 87,99 ----
DlgRect area (position, width () + 1, height () + 1);
! // draw everything to the surface - First border
! gdk_draw_arc (surface, gc, TRUE,
! position.x (), position.y (),
! CIRCLE_DIAMETER, CIRCLE_DIAMETER, 0, 360*64);
! // add a small circle inside that indicates the type (NPC, Player)
! gdk_draw_arc (surface, fgc, TRUE,
! position.x ()+2, position.y ()+2,
! CIRCLE_DIAMETER-4, CIRCLE_DIAMETER-4, 0, 360*64);
!
// Indicate whether node contains additional code
if (hasCode () || entry_->loop ())
Index: dlg_types.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_types.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** dlg_types.h 9 Nov 2002 21:47:02 -0000 1.8
--- dlg_types.h 10 Jan 2003 20:22:49 -0000 1.9
***************
*** 66,79 ****
enum
{
! GC_RED = 0,
! GC_DARK_RED = 1,
! GC_DARK_BLUE = 2,
! GC_GREEN = 3,
! GC_DARK_GREEN = 4,
! GC_YELLOW = 5,
! GC_GREY = 6,
! GC_BLACK = 7,
! GC_WHITE = 8,
! MAX_GC = 9
};
--- 66,80 ----
enum
{
! GC_BLACK = 0,
! GC_GREY = 1,
! GC_WHITE = 2,
! GC_DARK_RED = 3,
! GC_RED = 4,
! GC_DARK_GREEN = 5,
! GC_GREEN = 6,
! GC_BRIGHT_GREEN = 7,
! GC_DARK_BLUE = 8,
! GC_BLUE = 9,
! MAX_GC = 10
};
Index: gui_resources.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_resources.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** gui_resources.cc 2 Nov 2002 21:35:55 -0000 1.2
--- gui_resources.cc 10 Jan 2003 20:22:49 -0000 1.3
***************
*** 41,115 ****
GdkColor c;
! // Yellow
! Color[GC_YELLOW] = gdk_gc_new (gtk_widget_get_parent_window (widget));
! c.red = 65535;
! c.green = 32700;
! c.blue = 0;
! gdk_colormap_alloc_color (gtk_widget_get_colormap (widget), &c, TRUE,
TRUE);
! gdk_gc_set_foreground (Color[GC_YELLOW], &c);
!
! // Orange
! Color[GC_RED] = gdk_gc_new (gtk_widget_get_parent_window (widget));
! c.red = 65535;
! c.green = 16350;
! c.blue = 0;
! gdk_colormap_alloc_color (gtk_widget_get_colormap (widget), &c, TRUE,
TRUE);
! gdk_gc_set_foreground (Color[GC_RED], &c);
// Dark Red
! Color[GC_DARK_RED] = gdk_gc_new (gtk_widget_get_parent_window (widget));
! c.red = 65535;
c.green = 0;
! c.blue = 0;
! gdk_colormap_alloc_color (gtk_widget_get_colormap (widget), &c, TRUE,
TRUE);
gdk_gc_set_foreground (Color[GC_DARK_RED], &c);
! // Dark Blue
! Color[GC_DARK_BLUE] = gdk_gc_new (gtk_widget_get_parent_window (widget));
! c.red = 0;
! c.green = 0;
! c.blue = 35000;
! gdk_colormap_alloc_color (gtk_widget_get_colormap (widget), &c, TRUE,
TRUE);
! gdk_gc_set_foreground (Color[GC_DARK_BLUE], &c);
// Green
! Color[GC_GREEN] = gdk_gc_new (gtk_widget_get_parent_window (widget));
! c.red = 16000;
! c.green = 50000;
! c.blue = 5000;
! gdk_colormap_alloc_color (gtk_widget_get_colormap (widget), &c, TRUE,
TRUE);
gdk_gc_set_foreground (Color[GC_GREEN], &c);
// Dark Green
! Color[GC_DARK_GREEN] = gdk_gc_new (gtk_widget_get_parent_window (widget));
! c.red = 0;
c.green = 27300;
! c.blue = 15600;
! gdk_colormap_alloc_color (gtk_widget_get_colormap (widget), &c, TRUE,
TRUE);
gdk_gc_set_foreground (Color[GC_DARK_GREEN], &c);
! // Grey
! Color[GC_GREY] = gdk_gc_new (gtk_widget_get_parent_window (widget));
! c.red = 40000;
! c.green = 40000;
! c.blue = 40000;
! gdk_colormap_alloc_color (gtk_widget_get_colormap (widget), &c, TRUE,
TRUE);
! gdk_gc_set_foreground (Color[GC_GREY], &c);
! // Black
! Color[GC_BLACK] = gdk_gc_new (gtk_widget_get_parent_window (widget));
! c.red = 0;
c.green = 0;
! c.blue = 0;
! gdk_colormap_alloc_color (gtk_widget_get_colormap (widget), &c, TRUE,
TRUE);
! gdk_gc_set_foreground (Color[GC_BLACK], &c);
!
! // White
! Color[GC_WHITE] = gdk_gc_new (gtk_widget_get_parent_window (widget));
! c.red = 65535;
! c.green = 65535;
! c.blue = 65535;
! gdk_colormap_alloc_color (gtk_widget_get_colormap (widget), &c, TRUE,
TRUE);
! gdk_gc_set_foreground (Color[GC_WHITE], &c);
}
--- 41,127 ----
GdkColor c;
! GdkWindow *window = gtk_widget_get_parent_window (widget);
! GdkColormap *colormap = gtk_widget_get_colormap (widget);
!
! // Black
! Color[GC_BLACK] = gdk_gc_new (window);
! c.red = 0;
! c.green = 0;
! c.blue = 0;
! gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
! gdk_gc_set_foreground (Color[GC_BLACK], &c);
!
! // White
! Color[GC_WHITE] = gdk_gc_new (window);
! c.red = 65535;
! c.green = 65535;
! c.blue = 65535;
! gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
! gdk_gc_set_foreground (Color[GC_WHITE], &c);
!
! // Grey
! Color[GC_GREY] = gdk_gc_new (window);
! c.red = 50000;
! c.green = 50000;
! c.blue = 50000;
! gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
! gdk_gc_set_foreground (Color[GC_GREY], &c);
// Dark Red
! Color[GC_DARK_RED] = gdk_gc_new (window);
! c.red = 65535;
c.green = 0;
! c.blue = 0;
! gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
gdk_gc_set_foreground (Color[GC_DARK_RED], &c);
! // Red
! Color[GC_RED] = gdk_gc_new (window);
! c.red = 65535;
! c.green = 16350;
! c.blue = 0;
! gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
! gdk_gc_set_foreground (Color[GC_RED], &c);
// Green
! Color[GC_GREEN] = gdk_gc_new (window);
! c.red = 39680;
! c.green = 65355;
! c.blue = 45900;
! gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
gdk_gc_set_foreground (Color[GC_GREEN], &c);
// Dark Green
! Color[GC_DARK_GREEN] = gdk_gc_new (window);
! c.red = 0;
c.green = 27300;
! c.blue = 15600;
! gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
gdk_gc_set_foreground (Color[GC_DARK_GREEN], &c);
! // Bright Green
! Color[GC_BRIGHT_GREEN] = gdk_gc_new (window);
! c.red = 0;
! c.green = 47616;
! c.blue = 1536;
! gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
! gdk_gc_set_foreground (Color[GC_BRIGHT_GREEN], &c);
! // Dark Blue
! Color[GC_DARK_BLUE] = gdk_gc_new (window);
! c.red = 0;
c.green = 0;
! c.blue = 60000;
! gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
! gdk_gc_set_foreground (Color[GC_DARK_BLUE], &c);
!
! // Blue - like the sky
! Color[GC_BLUE] = gdk_gc_new (window);
! c.red = 32768;
! c.green = 58112;
! c.blue = 65535;
! gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
! gdk_gc_set_foreground (Color[GC_BLUE], &c);
!
}
***************
*** 129,135 ****
case IDLE:
{
! if (type == NPC || type == LINK || type == MODULE) return
Color[GC_BLACK];
else if (type == NARRATOR) return Color[GC_DARK_GREEN];
! else return Color[GC_DARK_BLUE];
}
--- 141,149 ----
case IDLE:
{
! if (type == NPC || type == LINK || type == MODULE)
! return Color[GC_BLACK];
else if (type == NARRATOR) return Color[GC_DARK_GREEN];
! else if (type == PLAYER) return Color[GC_DARK_BLUE];
! else return Color[GC_BLACK];
}
***************
*** 137,143 ****
case NODE_SELECTED:
{
! if (type == NPC || type == LINK || type == MODULE) return
Color[GC_DARK_RED];
! else if (type == NARRATOR) return Color[GC_YELLOW];
! else return Color[GC_RED];
}
--- 151,155 ----
case NODE_SELECTED:
{
! return Color[GC_DARK_RED];
}
***************
*** 145,151 ****
case NODE_HILIGHTED:
{
! return Color[GC_GREEN];
}
// unknown
default:
--- 157,183 ----
case NODE_HILIGHTED:
{
! return Color[GC_BRIGHT_GREEN];
}
+ // unknown
+ default:
+ return Color[GC_BLACK];
+ }
+
+ return (GdkGC *) NULL;
+ }
+
+ // Get the right Fill Color for a (mode, type) combination
+ // This color is going to be filled inside the node cirle
+ GdkGC *GuiResources::getFill (mode_type mode, node_type type)
+ {
+ switch (type)
+ {
+ case PLAYER:
+ return Color[GC_BLUE];
+ case NPC:
+ return Color[GC_GREY];
+ case NARRATOR:
+ return Color[GC_GREEN];
// unknown
default:
Index: gui_resources.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_resources.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** gui_resources.h 2 Nov 2002 18:40:02 -0000 1.1
--- gui_resources.h 10 Jan 2003 20:22:49 -0000 1.2
***************
*** 55,58 ****
--- 55,66 ----
static GdkGC *getColor (mode_type mode, node_type type);
/**
+ * Retrieve a color to fill drawn objects on a drawing area,
+ * depending on the given mode and type.
+ * @param mode the mode of a DlgNode
+ * @param type the type of a DlgNode
+ * @return a GdkGC.
+ */
+ static GdkGC *getFill (mode_type mode, node_type type);
+ /**
* Retrieve the font used to draw text onto a drawing area.
* @return a GdkFont.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Adonthell-commits] CVS: adonthell/src/tools/dlgedit dlg_circle.cc,1.9,1.10 dlg_types.h,1.8,1.9 gui_resources.cc,1.2,1.3gui_resources.h,1.1,1.2,
Kai Sterker <address@hidden> <=
- Prev by Date:
[Adonthell-commits] CVS: wastesedge/beos INSTALL,NONE,1.1 README,NONE,1.1 install-adonthell,NONE,1.1 uninstall-adonthell,NONE,1.1 wastesedge.rsrc,NONE,1.1
- Next by Date:
[Adonthell-commits] CVS: adonthell/src/tools/pydonthell Makefile.am,1.26,1.27 pydonthell.cc,1.8,1.9
- Previous by thread:
[Adonthell-commits] CVS: wastesedge/beos INSTALL,NONE,1.1 README,NONE,1.1 install-adonthell,NONE,1.1 uninstall-adonthell,NONE,1.1 wastesedge.rsrc,NONE,1.1
- Next by thread:
[Adonthell-commits] CVS: adonthell/src/tools/pydonthell Makefile.am,1.26,1.27 pydonthell.cc,1.8,1.9
- Index(es):