File: xtv.c

package info (click to toggle)
xtv 1.1-16
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 152 kB
  • sloc: ansic: 614; makefile: 193
file content (74 lines) | stat: -rw-r--r-- 1,468 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
** xtv.c for Mtds in .
** 
** Made by MaxTheDogSays (dubray_f@epita.fr && rancur_v@epita.fr)
** Login   <mtds@epita.fr>
** 
** Started on  Tue May  3 23:29:35 1994 mtds
** Updated on  Tue Apr  4 02:19:53 1995 mtds
** Minor mods  Sun Oct  7 13:42:49 MDT 2001 bap@cs.unm.edu
*/

#include <stdio.h>
#include <stdlib.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Xaw/Viewport.h>
#include "Grab.h"

typedef struct	_appl
{
   XtAppContext	app_context;
   Widget	toplevel;
   Widget	grab;
} appl;

static XrmOptionDescRec options[] =
{
{"-d",		"*displayName",
    XrmoptionSepArg,	NULL},
{"-s",		"*interval",
    XrmoptionSepArg,	NULL}
};

void usage()
{
   fprintf(stderr,"usage: xtv [-s refresh_timeout] [-d display]\n");
   exit(255);
}

int main(int argc, char **argv)
{
   appl		app;
   Widget	viewport;
   
   app.toplevel =
      XtVaAppInitialize(&(app.app_context),
			"XTv",
			options,
			XtNumber(options),
			&argc,
			argv,
			NULL,
			NULL);
   if (argc != 1)
      usage();
   viewport =
      XtVaCreateWidget("viewport",
		       viewportWidgetClass,
		       app.toplevel,
		       XtNallowHoriz,	TRUE,
		       XtNallowVert,	TRUE,
		       XtNwidth,	100,
		       XtNheight,	100,
		       NULL);
   app.grab =
      XtVaCreateManagedWidget("grab",
			      xmtdsGrabWidgetClass,
			      viewport,
			      NULL);
   XtManageChild(viewport);
   XtRealizeWidget(app.toplevel);
   XtAppMainLoop(app.app_context);
   return 0;
}