remove drawstring plugin
[wmaker-crm.git] / src / plugin.h
blobc5d8a655d9af72a8e6d243635d73de6cc04de699
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 struct _WPluginData {
43 int size;
44 void **array;
45 } WPluginData;
47 typedef void (*_DL_AnyProc)(proplist_t);
49 /* first 3 must == WS_FOCUSED WS_UNFOCUSED WS_PFOCUSED -- ]d */
50 #ifdef DRAWSTRING_PLUGIN
51 #define W_STRING_FTITLE 0
52 #define W_STRING_UTITLE 1
53 #define W_STRING_PTITLE 2
54 #define W_STRING_MTITLE 3
55 #define W_STRING_MTEXT 4
56 #define W_STRING_MEMBERS 5
58 typedef void _DL_DrawStringProc(proplist_t, Drawable, int, int, char*, int, WPluginData*);
59 typedef void _DL_WidthStringProc(char*, int, WPluginData*, int*, int*, int*);
60 #endif
62 typedef void _DL_FreeDataProc(proplist_t pl, WPluginData *free_data);
64 typedef int _DL_InitDataProc(proplist_t pl, WPluginData *init_data);
65 /* prototype for function initializer */
67 #define W_DSPROC_DRAWSTRING 0
68 #define W_DSPROC_WIDTHOFSTRING 1
69 #define W_DSPROC_MEMBERS 2
71 typedef struct _WFunction {
72 int type;
73 void *handle;
74 proplist_t arg;
75 WPluginData *data;
76 _DL_FreeDataProc *freeData;
77 union {
78 _DL_AnyProc **any;
79 #ifdef DRAWSTRING_PLUGIN
80 _DL_DrawStringProc **drawString;
81 _DL_WidthStringProc **widthOfString;
82 #endif
83 } proc;
85 char *libraryName;
86 char *procName;
87 char *freeDataProcName;
89 } WFunction;
91 /* for init_data, pass something like
92 * p = wmalloc(sizeof(void *) * 3)
93 * and let p[0]=display p[1]=colormap p[2]=cache (for keeping local data
94 * for each instance of function in each WFunction) to the initializing
95 * code for drawstring function... may be I can change this to a variable
96 * packer function? or use va_list? I dunno...
98 * --]d
101 WFunction* wPluginCreateFunction(int type, char *library_name,
102 char *init_proc_name, WPluginData *funcs, char *free_data_proc_name,
103 proplist_t pl_arg, WPluginData *init_data);
105 void wPluginDestroyFunction(WFunction *function);
107 WPluginData* wPluginPackData(int members, ...);
109 #endif