Changeset 5852 for trunk/Ohana/src/kii/setup/DefineLayout.c
- Timestamp:
- Dec 27, 2005, 3:23:01 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/kii/setup/DefineLayout.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/kii/setup/DefineLayout.c
r5700 r5852 5 5 void DefineLayout (Layout *layout, Graphic *graphic, int argc, char **argv) { 6 6 7 int i, status, N; 8 struct sockaddr_un Address; 9 char temp[100], *temp_name; 7 int i, N; 8 char *colormap; 10 9 11 10 /** initiate connection with mana **/ 12 if (! DEBUG) {11 if (!FOREGROUND) { 13 12 if (argc < 2) { 14 13 fprintf (stderr, "socket path not specified\n"); 15 14 exit (0); 16 15 } 17 strcpy (Address.sun_path, argv[1]); 18 Address.sun_family = AF_UNIX; 19 layout[0].Ximage = socket (AF_UNIX, SOCK_STREAM, 0); 20 status = connect (layout[0].Ximage, (struct sockaddr *) &Address, (socklen_t) sizeof (Address)); 21 if (status < 0) { 22 fprintf (stderr, "kii - unsuccessful connection: %d\n", status); 23 exit (0); 24 } 25 fcntl (layout[0].Ximage, F_SETFL, O_NONBLOCK); 26 sprintf (temp, "rm -f %s", argv[1]); 27 system (temp); 16 layout[0].Ximage = KiiWait (argv[1]); 28 17 } 29 18 … … 34 23 MakeColormap (graphic, layout, argc, argv); 35 24 } else { 36 temp_name= default_colormap;25 colormap = default_colormap; 37 26 if ((N = get_argument (argc, argv, "-cm"))) { 38 27 remove_argument (N, &argc, argv); 39 temp_name= argv[N];28 colormap = argv[N]; 40 29 } 41 30 layout[0].Npixels = 256; 42 SetColormap (graphic, layout, temp_name);31 SetColormap (graphic, layout, colormap); 43 32 } 44 33 … … 70 59 } 71 60 72 73 61 /* this routine is independent of the number of overlays */ 74 62 75 63 /* cmap = the mapping of value to color in kii 76 64 colormap = the set of pixel -> color representation in X */ 77
Note:
See TracChangeset
for help on using the changeset viewer.
