2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: c_api_graphic_test.C /main/5 1996/08/21 15:53:03 drk $ */
26 #include "oliasdb/DtMmdb.h"
30 void showGraphic(DtMmdbInfoRequest* req)
35 DtMmdbGraphicInfo* info ;
37 if ( req == 0 ) return ;
39 str = DtMmdbGraphicGetData( req, &l);
41 fprintf(stderr, " GraphicInfo: data=");
43 fprintf(stderr, "%c", str[i]);
44 fprintf(stderr, "\n");
47 info = DtMmdbGraphicGetInfo(req);
49 fprintf(stderr, " GraphicInfo: type=%d\n", info -> type);
50 fprintf(stderr, " GraphicInfo: width=%d\n", info -> width);
51 fprintf(stderr, " GraphicInfo: height=%d\n", info -> height);
52 fprintf(stderr, " GraphicInfo: llx=%d\n", info -> llx);
53 fprintf(stderr, " GraphicInfo: lly=%d\n", info -> lly);
54 fprintf(stderr, " GraphicInfo: urx=%d\n", info -> urx);
55 fprintf(stderr, " GraphicInfo: ury=%d\n", info -> ury);
56 DtMmdbFreeGraphicInfo(info);
60 str = DtMmdbGraphicGetLoc(req);
61 fprintf(stderr, " GraphicInfo: graphic's locator=%s\n", str);
67 int test_graphic1(int argc, char** argv)
71 DtMmdbInfoRequest* req;
76 i = DtMmdbOpenInfoLib(argv[2], argv[3], DtMmdbFalse);
77 j = DtMmdbGetBookCaseByName(i, argv[3]);
79 req = newDtMmdbInfoRequestWithLoc(j, argv[4]);
82 DtMmdbFreeInfoRequest(req);
83 DtMmdbCloseInfoLib(i);
88 fprintf(stderr, "invalid arguments\n");
91 fprintf(stderr, "infolib desc=%d\n", i);
97 int test_graphic2(int argc, char** argv)
101 DtMmdbInfoRequest* req;
106 i = DtMmdbOpenInfoLib(argv[2], argv[3], DtMmdbFalse);
107 j = DtMmdbGetBookCaseByName(i, argv[3]);
109 req = newDtMmdbInfoRequestWithPrimaryOid(j, argv[4]);
112 DtMmdbFreeInfoRequest(req);
113 DtMmdbCloseInfoLib(i);
118 fprintf(stderr, "invalid arguments\n");
121 fprintf(stderr, "infolib desc=%d\n", i);