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,
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
39 #define W_FUNCTION_ANY 0
40 #define W_FUNCTION_DRAWSTRING 1
42 typedef struct _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*);
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
{
76 _DL_FreeDataProc
*freeData
;
79 #ifdef DRAWSTRING_PLUGIN
80 _DL_DrawStringProc
**drawString
;
81 _DL_WidthStringProc
**widthOfString
;
87 char *freeDataProcName;
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...
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
, ...);