#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <zakdef.h>
#include <simulation.h>
#include <ui.h>
#include <globals.h>
#include <main.h>
#include <drawing.h>
#include <string.h>
#include <strings.h>
#include <assert.h>
Go to the source code of this file.
Data Structures | |
struct | button_list |
the list of buttons and fields they care about More... | |
struct | tag_pmh |
pixmap handles for the map More... | |
Defines | |
#define | SHOW_POWER 1 |
show the power bitmap | |
#define | SHOW_WATER (SHOW_POWER<<1) |
show the water bitmap | |
Enumerations | |
enum | ccr_t |
color need/desire table | |
Functions | |
void | bpwater_clicked (GtkWidget *widget, gpointer data) |
one of the buttons was clicked | |
gint | close_window (GtkWidget *wid, gpointer data) |
close the window | |
void | updateAMap (Int16 xpos, Int16 ypos, GdkColor *col, ccr_t carry, GdkDrawable *dw_ori, GdkDrawable *dw_mask) |
update one of the maps | |
ccr_t | checkCommon (welem_t world, selem_t flag, carryfn_t carry, UInt8 flagbit) |
check if the node carries the specific flagged item | |
void | updatePower (Int16 xpos, Int16 ypos, ccr_t has_carry) |
update a power field | |
void | updateWater (Int16 xpos, Int16 ypos, ccr_t has_carry) |
update a water field | |
void | doPixPaint (void) |
initialize the map initialize the painting structures | |
gint | expose_pw (GtkWidget *area, GdkEventExpose *event, gpointer data) |
handle the window being exposed | |
void | showMap (void) |
show the map | |
void | UIPaintMapField (UInt16 xpos, UInt16 ypos, welem_t elem) |
update an individual position on the map | |
void | UIPaintMapStatus (UInt16 xpos, UInt16 ypos, welem_t world, selem_t status) |
update a map status position | |
void | resizeMap (void) |
resize the map ... need to recreate all the elements | |
Variables | |
GtkWidget * | pw_win |
window handle | |
GtkWidget * | dw_area |
pointer to the drawing area | |
tag_pmh | pmh |
pixmap handles for the map | |
int | shown_pixmaps |
govern the visibility of the water and power pixmaps | |
GtkWidget * | button_power |
handle for the power button | |
GtkWidget * | button_water |
handle for the water button | |
button_list | list_buttons [] |
the list of buttons and fields they care about | |
GdkColor | colBlank = { 0, 0, 0, 0 } |
blank color | |
GdkColor | colNeedPower = { 1, 255, 0, 0 } |
need power color | |
GdkColor | colNeedWater = { 1, 0, 0, 255 } |
need water color | |
GdkColor | colFull = { 2, 255, 255, 255 } |
power/ware is supplied color |
Displays the map/power/water distribution graphs. principal is: red == need power, blue == need water When supplied the node turns black, otherwise it stays the bad color
This code is really part of the map functionality. I just need it for debugging for the moment.
Definition in file simulation-ui.c.
|
one of the buttons was clicked
Definition at line 68 of file simulation-ui.c. References button_list::button, dw_area, button_list::field, list_buttons, and shown_pixmaps. Referenced by showMap(). |
|
check if the node carries the specific flagged item
Definition at line 175 of file simulation-ui.c. References selem_t, UInt8, and welem_t. Referenced by UIPaintMapStatus(). |
|
close the window
Definition at line 99 of file simulation-ui.c. References pw_win. Referenced by showMap(). |
|
handle the window being exposed
Definition at line 276 of file simulation-ui.c. References tag_pmh::allmap, pmh, tag_pmh::power, tag_pmh::power_mask, SHOW_POWER, SHOW_WATER, tag_pmh::water, and tag_pmh::water_mask. Referenced by showMap(). |
|
update an individual position on the map this would consist of painting it's location, as well as the power and water items for that location. It is the map version of UIDrawField.
Definition at line 378 of file simulation-ui.c. References tag_pmh::allmap, doPixPaint(), pmh, UIDrawMapZone(), UInt16, and welem_t. Referenced by BuildSomething(), and DrawFieldWithoutInit(). |
|
update a map status position
Definition at line 388 of file simulation-ui.c. References checkCommon(), POWEREDBIT, selem_t, UInt16, updatePower(), updateWater(), WATEREDBIT, and welem_t. Referenced by BuildSomething(), and DrawFieldWithoutInit(). |
|
update one of the maps
Definition at line 139 of file simulation-ui.c. References ccr_t, colBlank, colFull, and Int16. Referenced by updatePower(), and updateWater(). |
|
update a power field
Definition at line 191 of file simulation-ui.c. References ccr_t, colNeedPower, Int16, pmh, tag_pmh::power, tag_pmh::power_mask, and updateAMap(). Referenced by UIPaintMapStatus(). |
|
update a water field
Definition at line 205 of file simulation-ui.c. References ccr_t, colNeedWater, Int16, pmh, updateAMap(), tag_pmh::water, and tag_pmh::water_mask. Referenced by UIPaintMapStatus(). |