Fixed code for MMX detection to work.
[wmaker-crm.git] / src / plugin.h
blobb6dae22b3e5fb8c576d5431ce60bba6fdd6f5749
1 /* plugin.h- plugin
3 * Window Maker window manager
5 * Copyright (c) hmmm... Should I put everybody's name here?
6 * Where's my lawyer?? -- ]d :D
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
21 * USA.
23 * * * * * * * * *
24 * Do you think I should move this code into another file? -- ]d
26 * BTW, should this file be able to be included by any plugin file that
27 * want _DL ?
31 #ifndef WMPLUGIN_H
32 #define WMPLUGIN_H
34 #include "wconfig.h"
36 #include <WINGs.h>
37 #include <proplist.h>
39 #define W_FUNCTION_ANY 0
40 #define W_FUNCTION_DRAWSTRING 1
42 typedef void _DL_AnyProc(proplist_t);
44 /* first 3 must == WS_FOCUSED WS_UNFOCUSED WS_PFOCUSED -- ]d */
45 #ifdef DRAWSTRING_PLUGIN
46 #define W_STRING_FTITLE 0
47 #define W_STRING_UTITLE 1
48 #define W_STRING_PTITLE 2
49 #define W_STRING_MTITLE 3
50 #define W_STRING_MTEXT 4
51 #define W_STRING_MEMBERS 5
53 typedef void _DL_DrawStringProc(proplist_t, Drawable, GC, WMFont *, int, int, unsigned, unsigned, char *, int);
54 #endif
56 typedef void _DL_FreeDataProc(void *free_me);
58 typedef int _DL_InitDataProc(proplist_t pl, void *init_data); /* prototype
59 for function
60 initializer
63 typedef struct _WFunction {
64 int type;
65 void *handle;
66 proplist_t arg;
67 void *data;
68 _DL_FreeDataProc *freeData;
69 union {
70 _DL_AnyProc *any;
71 #ifdef DRAWSTRING_PLUGIN
72 _DL_DrawStringProc *drawString;
73 #endif
74 } proc;
76 char *libraryName;
77 char *procName;
78 char *freeDataProcName;
80 } WFunction;
82 /* for init_data, pass something like
83 * p = wmalloc(sizeof(void *) * 3)
84 * and let p[0]=display p[1]=colormap p[2]=cache (for keeping local data
85 * for each instance of function in each WFunction) to the initializing
86 * code for drawstring function... may be I can change this to a variable
87 * packer function? or use va_list? I dunno...
89 * --]d
92 WFunction* wPluginCreateFunction(int type, char *library_name,
93 char *init_proc_name, char *proc_name, char *free_data_proc_name,
94 proplist_t pl_arg, void *init_data);
96 void wPluginDestroyFunction(WFunction *function);
98 void** wPluginPackInitData(int members, ...);
100 #endif