~ubuntu-branches/ubuntu/trusty/xosd/trusty

« back to all changes in this revision

Viewing changes to osd_cat.c

  • Committer: Bazaar Package Importer
  • Author(s): Martijn van de Streek
  • Date: 2001-12-10 08:26:33 UTC
  • Revision ID: james.westby@ubuntu.com-20011210082633-7bhp3yvyd90q6ttv
Tags: 0.7.0-4
Make libxosd-dev depend on xlibs-dev (closes: #123160) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
    {"color",  1, NULL, 'c'},
11
11
    {"delay",  1, NULL, 'd'},
12
12
    {"offset", 1, NULL, 'o'},
 
13
    {"shadow", 1, NULL, 's'},
13
14
    {"top",    0, NULL, 't'},
14
15
    {"bottom", 0, NULL, 'b'},
15
16
    {"help",   0, NULL, 'h'},
28
29
   int delay = 5;
29
30
   xosd_pos pos = XOSD_top;
30
31
   int offset = 0;
31
 
 
 
32
   int shadow = 0;
 
33
   
32
34
   while (1)
33
35
   {
34
36
       int option_index = 0;
35
 
       int c = getopt_long (argc, argv, "f:c:d:o:tbh", long_options, &option_index);
 
37
       int c = getopt_long (argc, argv, "f:c:d:s:o:tbh", long_options, &option_index);
36
38
       if (c == -1) break;
37
39
       switch (c)
38
40
       {
48
50
           case 'o':
49
51
               offset = atoi(optarg);
50
52
               break;
 
53
           case 's':
 
54
               shadow = atoi(optarg);
 
55
               break;
51
56
           case 't':
52
57
               pos = XOSD_top;
53
58
               break;
64
69
               fprintf (stderr, "  -c, --color=COLOR   Use color\n");
65
70
               fprintf (stderr, "  -d, --delay=TIME    Show for specified time\n");
66
71
               fprintf (stderr, "  -o, --offset=OFFSET Display Offset\n");
 
72
               fprintf (stderr, "  -s, --shadow=OFFSET Shadow Offset\n");
67
73
               fprintf (stderr, "  -h, --help          Show this help\n");
68
74
               fprintf (stderr, "\nWith no FILE, or when FILE is -, read standard input.\n");
69
75
               return EXIT_SUCCESS;
81
87
   else
82
88
      fp = stdin;
83
89
   
84
 
   osd = xosd_init (font, color, delay, pos, offset, 0);
 
90
   osd = xosd_init (font, color, delay, pos, offset, shadow);
85
91
   if (!osd)
86
92
      {
87
93
      fprintf (stderr, "Error initializing osd\n");
92
98
      {
93
99
      fgets (buffer, 1023, fp);
94
100
      if ((newline = strchr (buffer, '\n')))
95
 
         newline[0] = '\0';
 
101
        newline[0] = '\0';
96
102
      xosd_display (osd, 1, XOSD_string, buffer);
97
103
      }
98
104