Changeset 27637
- Timestamp:
- Apr 8, 2010, 8:39:05 AM (16 years ago)
- Location:
- branches/eam_branches/Ohana.20100407/src
- Files:
-
- 10 edited
-
kapa2/include/prototypes.h (modified) (3 diffs)
-
kapa2/include/structures.h (modified) (1 diff)
-
kapa2/src/DefineSection.c (modified) (1 diff)
-
kapa2/src/EraseSections.c (modified) (1 diff)
-
kapa2/src/Layout.c (modified) (1 diff)
-
kapa2/src/Refresh.c (modified) (2 diffs)
-
kapa2/src/Sections.c (modified) (2 diffs)
-
kapa2/src/SetGraphSize.c (modified) (1 diff)
-
libkapa/include/kapa.h (modified) (1 diff)
-
opihi/cmd.data/section.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/Ohana.20100407/src/kapa2/include/prototypes.h
r27530 r27637 47 47 int Reconfig PROTO((XEvent *event)); 48 48 void Refresh PROTO((void)); 49 void DrawSectionBG PROTO((Graphic *graphic, Section *section)); 49 50 50 51 /* CheckPipe */ … … 61 62 int SetSection PROTO((int sock)); 62 63 int ListSection PROTO((int sock)); 64 int SetSectionBG PROTO((int sock)); 63 65 int MoveSection PROTO((int sock)); 64 66 int DefineSection PROTO((int sock)); … … 84 86 void FreeSection PROTO((Section *section)); 85 87 void FreeSections PROTO((void)); 86 Section *AddSection PROTO((char *name, float x, float y, float dx, float dy ));88 Section *AddSection PROTO((char *name, float x, float y, float dx, float dy, int bg)); 87 89 int DelSection PROTO((char *name)); 88 90 int GetSectionByName PROTO((char *name)); -
branches/eam_branches/Ohana.20100407/src/kapa2/include/structures.h
r25757 r27637 210 210 float x, y; 211 211 float dx, dy; 212 int bg; 212 213 char *name; 213 214 } Section; -
branches/eam_branches/Ohana.20100407/src/kapa2/src/DefineSection.c
r27636 r27637 4 4 int DefineSection (int sock) { 5 5 6 int N, MoveSection ;6 int N, MoveSection, bg; 7 7 char name[128]; 8 8 double x, y, dx, dy; -
branches/eam_branches/Ohana.20100407/src/kapa2/src/EraseSections.c
r21153 r27637 8 8 9 9 FreeSections (); 10 AddSection ("default", 0.0, 0.0, 1.0, 1.0 );10 AddSection ("default", 0.0, 0.0, 1.0, 1.0, -1); 11 11 12 12 if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window); -
branches/eam_branches/Ohana.20100407/src/kapa2/src/Layout.c
r14737 r27637 43 43 44 44 /* create basic section, empty of image or graph */ 45 section = AddSection ("default", 0.0, 0.0, 1.0, 1.0 );45 section = AddSection ("default", 0.0, 0.0, 1.0, 1.0, -1); 46 46 } -
branches/eam_branches/Ohana.20100407/src/kapa2/src/Refresh.c
r21153 r27637 21 21 for (i = 0; i < Nsection; i++) { 22 22 section = GetSectionByNumber (i); 23 DrawSectionBG (graphic, section); 23 24 DrawImage (section->image); 24 25 DrawGraph (section->graph); … … 28 29 } 29 30 31 void DrawSectionBG (Graphic *graphic, Section *section) { 32 33 int X0, Y0, dX, dY; 34 if (section->bg == -1) return; 35 36 XSetForeground (graphic->display, graphic->gc, graphic->color[section->bg]); 37 38 dY = graphic[0].dy * section[0].dy; 39 dX = graphic[0].dx * section[0].dx; 40 Y0 = graphic[0].dy - graphic[0].dy * section[0].y - dY; 41 X0 = graphic[0].dx * section[0].x; 42 fprintf (stderr, "section: (%s) %d %d - %d %d\n", section[0].name, X0, Y0, dX, dY); 43 44 XFillRectangle (graphic[0].display, graphic[0].window, graphic[0].gc, X0, Y0, dX, dY); 45 return; 46 } -
branches/eam_branches/Ohana.20100407/src/kapa2/src/Sections.c
r27636 r27637 93 93 } 94 94 95 int SetSectionBG (char *name) {96 97 int i;98 99 for (i = 0; i < Nsections; i++) {100 if (strcmp (name, sections[i][0].name)) continue;101 sections[i][0].bg =102 }103 return (-1);104 }105 106 95 int GetNumberOfSections () { 107 96 return (Nsections); … … 168 157 } 169 158 159 int SetSectionBG (int sock) { 160 161 int N, background; 162 char name[128]; 163 164 KiiScanMessage (sock, "%s %d", name, &background); 165 166 N = GetSectionByName (name); 167 if (N < 0) { 168 fprintf (stderr, "section %s not found\n", name); 169 return (TRUE); 170 } 171 172 sections[N][0].bg = background; 173 174 return (TRUE); 175 } 176 170 177 // return TRUE even for nonsense cases to avoid quitting kapa 171 178 int MoveSection (int sock) { -
branches/eam_branches/Ohana.20100407/src/kapa2/src/SetGraphSize.c
r16011 r27637 62 62 } 63 63 } 64 fprintf (stderr, "graph: (%s) %f %f - %f %f\n", section[0].name, X0, Y0, dX, dY); 64 65 65 66 /* define locations of coordinate axes */ -
branches/eam_branches/Ohana.20100407/src/libkapa/include/kapa.h
r27636 r27637 174 174 int KapaSelectSection (int fd, char *name); 175 175 int KapaGetSection (int fd, char *name); 176 int KapaSectionBG (int fd, char *name, int bg); 176 177 int KapaMoveSection (int fd, char *name, char *direction); 177 178 int KapaSetGraphData (int fd, Graphdata *graphmode); -
branches/eam_branches/Ohana.20100407/src/opihi/cmd.data/section.c
r27636 r27637 5 5 int section (int argc, char **argv) { 6 6 7 int N, action, kapa ;7 int N, action, kapa, background; 8 8 Graphdata graphmode; 9 9 KapaSection section; … … 91 91 92 92 case BG: 93 KapaSectionBG (kapa, argv[1], b g);93 KapaSectionBG (kapa, argv[1], background); 94 94 break; 95 95
Note:
See TracChangeset
for help on using the changeset viewer.
