File: xtv.c

package info (click to toggle)
xtv 1.1-3
  • links: PTS
  • area: main
  • in suites: hamm, potato, slink
  • size: 84 kB
  • ctags: 254
  • sloc: ansic: 348; makefile: 223
file content (73 lines) | stat: -rw-r--r-- 1,388 bytes parent folder | download | duplicates (5)
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
/*
** 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
** Last update Tue Apr  4 02:19:53 1995 mtds
*/

#include <stdio.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}
};

int		main(argc,argv)
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);
}

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