1 /* pbar.h: handles rate-of-change indicators 2 * This file is part of lincity. 3 * Lincity is copyright (c) I J Peters 1995-1997, (c) Greg Sharp 1997-2001. 4 * Portions copyright (c) 2001 Corey Keasling. 5 * ---------------------------------------------------------------------- */ 6 7 #ifndef _pbar_h 8 #define _pbar_h 9 10 #include "geometry.h" 11 12 void init_pbars (void); 13 void pbars_full_refresh (void); 14 void init_pbar_text (void); 15 void draw_pbar (Rect* b, char* graphic); 16 void draw_pbars (void); 17 void clear_pbar_text (Rect* pbar); 18 void write_pbar_int (Rect* b, int val); 19 void write_pbar_text (Rect* b, char * s); 20 void refresh_pbars (void); 21 void refresh_population_text (void); 22 23 void update_pbar (int pbar_num, int value, int month_flag); 24 void update_pbars_daily(void); 25 void update_pbars_monthly(void); 26 int compute_pbar_offset (Rect* b, int val); 27 void draw_pbar_new (Rect* b, int val); 28 void pbar_mouse(int rawx, int rawy, int button); 29 30 /* Constants */ 31 32 #define PBAR_POP_X (PBAR_AREA_X + 4) 33 #define PBAR_POP_Y (PBAR_AREA_Y + 4) 34 #define PBAR_TECH_X PBAR_POP_X 35 #define PBAR_TECH_Y PBAR_POP_Y+(PBAR_H+1) 36 #define PBAR_FOOD_X PBAR_POP_X 37 #define PBAR_FOOD_Y PBAR_POP_Y+(PBAR_H+1)*2 38 #define PBAR_JOBS_X PBAR_POP_X 39 #define PBAR_JOBS_Y PBAR_POP_Y+(PBAR_H+1)*3 40 #define PBAR_COAL_X PBAR_POP_X 41 #define PBAR_COAL_Y PBAR_POP_Y+(PBAR_H+1)*4 42 #define PBAR_GOODS_X PBAR_POP_X 43 #define PBAR_GOODS_Y PBAR_POP_Y+(PBAR_H+1)*5 44 #define PBAR_ORE_X PBAR_POP_X 45 #define PBAR_ORE_Y PBAR_POP_Y+(PBAR_H+1)*6 46 #define PBAR_STEEL_X PBAR_POP_X 47 #define PBAR_STEEL_Y PBAR_POP_Y+(PBAR_H+1)*7 48 #define PBAR_MONEY_X PBAR_POP_X 49 #define PBAR_MONEY_Y PBAR_POP_Y+(PBAR_H+1)*8 50 51 /* Type:Position constants for pbars struct */ 52 53 #define PPOP 0 54 #define PTECH 1 55 #define PFOOD 2 56 #define PJOBS 3 57 #define PMONEY 4 58 #define PCOAL 5 59 #define PGOODS 6 60 #define PORE 7 61 #define PSTEEL 8 62 63 64 #define NUM_PBARS 9 65 66 /* Number of elements per pbar */ 67 #define PBAR_DATA_SIZE 12 68 69 struct pbar_st 70 { 71 int oldtot; 72 int tot; 73 int diff; 74 75 int data_size; 76 int data[PBAR_DATA_SIZE]; 77 }; 78 79 extern struct pbar_st pbars[NUM_PBARS]; 80 81 #endif 82 83 84 85 86