File indexing completed on 2024-04-28 15:35:16

0001 /***************************************************************************
0002  *   Copyright (C) 2004 by Tomas Mecir                                     *
0003  *   kmuddy@kmuddy.org                                                     *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU Library General Public License as       *
0007  *   published by the Free Software Foundation; either version 2 of the    *
0008  *   License, or (at your option) any later version.                       *
0009  *                                                                         *
0010  *   This program is distributed in the hope that it will be useful,       *
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *   GNU Library General Public License for more details.                  *
0014  ***************************************************************************/
0015 
0016 #include "libmxp.h"
0017 #include "cmxpprocessor.h"
0018 
0019 #ifdef __cplusplus
0020 extern "C" {
0021 #endif 
0022 
0023 MXPHANDLER mxpCreateHandler ()
0024 {
0025   cMXPProcessor *proc = new cMXPProcessor;
0026   return (MXPHANDLER) proc;
0027 }
0028 
0029 void mxpDestroyHandler (MXPHANDLER handler)
0030 {
0031   delete (cMXPProcessor *) handler;
0032 }
0033 
0034 void mxpProcessText (MXPHANDLER handler, const char *text)
0035 {
0036   ((cMXPProcessor *) handler)->processText (text);
0037 }
0038 
0039 mxpResult *mxpNextResult (MXPHANDLER handler)
0040 {
0041   return ((cMXPProcessor *) handler)->nextResult ();
0042 }
0043 
0044 char mxpHasResults (MXPHANDLER handler)
0045 {
0046   return ((cMXPProcessor *) handler)->hasResults ();
0047 }
0048 
0049 void mxpSwitchToOpen (MXPHANDLER handler)
0050 {
0051   ((cMXPProcessor *) handler)->switchToOpen ();
0052 }
0053 
0054 void mxpSetDefaultText (MXPHANDLER handler, const char *font, int size, char _bold,
0055     char _italic, char _underline, char _strikeout, RGB fg, RGB bg)
0056 {
0057   ((cMXPProcessor *) handler)->setDefaultText (font, size, _bold, _italic, _underline,
0058       _strikeout, fg, bg);
0059 }
0060 
0061 void mxpSetHeaderParams (MXPHANDLER handler, int which, const char *font, int size, char _bold,
0062     char _italic, char _underline, char _strikeout, RGB fg, RGB bg)
0063 {
0064   ((cMXPProcessor *) handler)->setHeaderParams (which, font, size, _bold, _italic, _underline,
0065       _strikeout, fg, bg);
0066 }
0067 
0068 void mxpSetDefaultGaugeColor (MXPHANDLER handler, RGB color)
0069 {
0070   ((cMXPProcessor *) handler)->setDefaultGaugeColor (color);
0071 }
0072 
0073 void mxpSetNonProportFont (MXPHANDLER handler, const char *font)
0074 {
0075   ((cMXPProcessor *) handler)->setNonProportFont (font);
0076 }
0077 
0078 void mxpSetClient (MXPHANDLER handler, const char *name, const char *version)
0079 {
0080   ((cMXPProcessor *) handler)->setClient (name, version);
0081 }
0082 
0083 void mxpSetScreenProps (MXPHANDLER handler, int sx, int sy, int wx, int wy, int fx, int fy)
0084 {
0085   ((cMXPProcessor *) handler)->setScreenProps (sx, sy, wx, wy, fx, fy);
0086 }
0087 
0088 //things that the client supports...
0089 
0090 void mxpSupportsLink (MXPHANDLER handler, char supports)
0091 {
0092   ((cMXPProcessor *) handler)->supportsLink (supports);
0093 }
0094 
0095 void mxpSupportsGauge (MXPHANDLER handler, char supports)
0096 {
0097   ((cMXPProcessor *) handler)->supportsGauge (supports);
0098 }
0099 
0100 void mxpSupportsStatus (MXPHANDLER handler, char supports)
0101 {
0102   ((cMXPProcessor *) handler)->supportsStatus (supports);
0103 }
0104 
0105 void mxpSupportsSound (MXPHANDLER handler, char supports)
0106 {
0107   ((cMXPProcessor *) handler)->supportsStatus (supports);
0108 }
0109 
0110 void mxpSupportsFrame (MXPHANDLER handler, char supports)
0111 {
0112   ((cMXPProcessor *) handler)->supportsFrame (supports);
0113 }
0114 
0115 void mxpSupportsImage (MXPHANDLER handler, char supports)
0116 {
0117   ((cMXPProcessor *) handler)->supportsImage (supports);
0118 }
0119 
0120 void mxpSupportsRelocate (MXPHANDLER handler, char supports)
0121 {
0122   ((cMXPProcessor *) handler)->supportsRelocate (supports);
0123 }
0124 
0125 #ifdef __cplusplus
0126 };
0127 #endif