Move frequently used opaque type definitions to etypes.h.

SVN revision: 21913
This commit is contained in:
Kim Woelders 2006-04-06 21:20:16 +00:00
parent 14736e21c1
commit 33aff75d26
24 changed files with 134 additions and 124 deletions

10
src/E.h
View File

@ -236,15 +236,11 @@ int Esnprintf(va_alist);
/*
* Types
*/
struct _border;
typedef struct _ewin EWin;
typedef struct _ecursor ECursor;
#include "etypes.h"
typedef struct _client Client;
typedef struct _constraints
typedef struct
{
int min, max;
}
@ -980,7 +976,7 @@ void WarpFocus(int delta);
/* windowmatch.c */
int WindowMatchConfigLoad(FILE * fs);
struct _border *WindowMatchEwinBorder(const EWin * ewin);
Border *WindowMatchEwinBorder(const EWin * ewin);
const char *WindowMatchEwinIcon(const EWin * ewin);
void WindowMatchEwinOps(EWin * ewin);

View File

@ -51,6 +51,7 @@ e16_SOURCES = \
emodule.h \
eobj.c \
eobj.h \
etypes.h \
events.c \
ewins.c \
ewins.h \

View File

@ -24,10 +24,7 @@
#ifndef _ACLASS_H
#define _ACLASS_H
struct _ewin;
typedef struct _action Action;
typedef struct _actionclass ActionClass;
#include "etypes.h"
/* aclass.c */
int AclassConfigLoad(FILE * fs);
@ -48,7 +45,7 @@ const char *ActionclassGetTooltipString(ActionClass * ac);
int ActionclassGetActionCount(ActionClass * ac);
Action *ActionclassGetAction(ActionClass * ac, int ix);
int ActionclassEvent(ActionClass * ac, XEvent * ev,
struct _ewin *ewin);
EWin * ewin);
int ActionclassesGlobalEvent(XEvent * ev);
const char *ActionGetTooltipString(Action * aa);
@ -57,7 +54,7 @@ int ActionGetEvent(Action * aa);
int ActionGetButton(Action * aa);
int ActionGetModifiers(Action * aa);
void GrabButtonGrabs(struct _ewin *ewin);
void UnGrabButtonGrabs(struct _ewin *ewin);
void GrabButtonGrabs(EWin * ewin);
void UnGrabButtonGrabs(EWin * ewin);
#endif /* _ACLASS_H */

View File

@ -24,8 +24,6 @@
#ifndef _BACKGROUNDS_H_
#define _BACKGROUNDS_H_
typedef struct _background Background;
/* backgrounds.c */
Background *BackgroundFind(const char *name);

View File

@ -25,8 +25,9 @@
#define _BORDERS_H_
#include "eimage.h"
#include "etypes.h"
typedef struct _winpoint
typedef struct
{
int originbox;
struct
@ -38,19 +39,19 @@ typedef struct _winpoint
}
WinPoint;
typedef struct _geometry
typedef struct
{
Constraints width, height;
WinPoint topleft, bottomright;
}
Geometry;
typedef struct _winpart
typedef struct
{
Geometry geom;
struct _imageclass *iclass;
struct _actionclass *aclass;
struct _textclass *tclass;
ImageClass *iclass;
ActionClass *aclass;
TextClass *tclass;
ECursor *ec;
signed char ontop;
int flags;
@ -58,7 +59,7 @@ typedef struct _winpart
}
WinPart;
typedef struct _border
struct _border
{
char *name;
char *group_border_name;
@ -69,11 +70,10 @@ typedef struct _border
char shadedir;
char throwaway;
unsigned int ref_count;
struct _actionclass *aclass;
}
Border;
ActionClass *aclass;
};
typedef struct _ewinbit
struct _ewinbit
{
EWin *ewin; /* Belongs to */
Window win;
@ -83,10 +83,9 @@ typedef struct _ewinbit
char expose;
char no_expose;
char left;
struct _imagestate *is;
struct _textstate *ts;
}
EWinBit;
ImageState *is;
TextState *ts;
};
/* borders.c */
Border *BorderFind(const char *name);

View File

@ -38,7 +38,7 @@
ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | \
PointerMotionMask)
typedef struct _bgeometry
typedef struct
{
Constraints width, height;
int xorigin, yorigin;

View File

@ -25,21 +25,14 @@
#define _BUTTONS_H_
#include "eobj.h"
#include "etypes.h"
struct _actionclass;
struct _desk;
struct _imageclass;
struct _textclass;
typedef struct _button Button;
typedef void (ButtonCbFunc) (EObj * eo, XEvent * ev,
struct _actionclass * ac);
typedef void (ButtonCbFunc) (EObj * eo, XEvent * ev, ActionClass * ac);
/* buttons.c */
Button *ButtonCreate(const char *name, int id,
struct _imageclass *ic,
struct _actionclass *ac, struct _textclass *tc,
ImageClass * ic,
ActionClass * ac, TextClass * tc,
const char *label, char ontop, int flags,
int minw, int maxw, int minh, int maxh, int xo,
int yo, int xa, int xr, int ya, int yr,
@ -56,16 +49,15 @@ void ButtonDecRefcount(Button * b);
void ButtonSwallowInto(Button * b, EObj * eo);
void ButtonSetCallback(Button * b, ButtonCbFunc * func,
EObj * eo);
int ButtonGetInfo(const Button * b, RectBox * r,
struct _desk *d);
int ButtonGetInfo(const Button * b, RectBox * r, Desk * d);
int ButtonDoShowDefault(const Button * b);
int ButtonEmbedWindow(Button * ButtonToUse,
Window WindowToEmbed);
Button **ButtonsGetList(int *pnum);
void ButtonsForeach(int id, struct _desk *dsk,
void ButtonsForeach(int id, Desk * dsk,
void (*func) (Button * b));
void ButtonsMoveStickyToDesk(struct _desk *d);
void ButtonsMoveStickyToDesk(Desk * d);
int ButtonsConfigLoad(FILE * fs);
#endif /* _BUTTONS_H_ */

View File

@ -47,7 +47,7 @@
#define ENLIGHTENMENT_CONF_NUM_DESKTOPS 32
typedef struct _desktops
typedef struct
{
Desk *current;
Desk *previous;

View File

@ -25,6 +25,7 @@
#define _DESKTOPS_H_
#include "eobj.h"
#include "etypes.h"
#define USE_BG_WIN_ON_ALL_DESKS 0
@ -33,24 +34,19 @@
#define DESK_BG_TIMEOUT 3
#define DESK_BG_RECONFIGURE_ALL 4
typedef struct _desk Desk;
struct _background;
struct _button;
struct _desk
{
EObj o;
unsigned int num;
char viewable;
char visible;
struct _button *tag;
Button *tag;
int current_area_x;
int current_area_y;
long event_mask;
struct
{
struct _background *bg;
Background *bg;
EObj *o;
#if USE_COMPOSITE
EObj *o_bg;
@ -79,10 +75,10 @@ void DeskGotoNum(unsigned int desk);
void DeskRestack(Desk * dsk);
Window DeskGetBackgroundWin(const Desk * dsk);
struct _background *DeskBackgroundGet(const Desk * dsk);
void DeskBackgroundSet(Desk * dsk, struct _background *bg);
Background *DeskBackgroundGet(const Desk * dsk);
void DeskBackgroundSet(Desk * dsk, Background * bg);
void DesksBackgroundRefresh(struct _background *bg, int what);
void DesksBackgroundRefresh(Background * bg, int what);
void DeskCurrentGetArea(int *ax, int *ay);
void DeskCurrentGotoArea(int ax, int ay);

View File

@ -47,11 +47,9 @@
#define DLG_OAC 7
#define DLG_OC 5
struct _imageclass;
struct _textclass;
typedef struct _dialog Dialog;
typedef struct _ditem DItem;
typedef void (DialogCallbackFunc) (Dialog * d, int val, void *data);
typedef void (DialogItemCallbackFunc) (int val, void *data);
@ -82,8 +80,8 @@ DItem *DialogInitItem(Dialog * d);
DItem *DialogAddItem(DItem * dii, int type);
void DialogItemSetCallback(DItem * di, DialogCallbackFunc * func,
int val, void *data);
void DialogItemSetClass(DItem * di, struct _imageclass *ic,
struct _textclass *tclass);
void DialogItemSetClass(DItem * di, ImageClass * ic,
TextClass * tclass);
void DialogItemSetPadding(DItem * di, int left, int right,
int top, int bottom);
void DialogItemSetFill(DItem * di, char fill_h, char fill_v);

View File

@ -703,7 +703,7 @@ ECompMgrDamageAll(void)
static Picture transBlackPicture;
typedef struct _conv
typedef struct
{
int size;
double *data;

View File

@ -26,6 +26,7 @@
#if USE_COMPOSITE
#include "eobj.h"
#include "etypes.h"
typedef struct
{
@ -35,13 +36,11 @@ typedef struct
int fade_speed;
} cfg_composite;
struct _desk;
int EVisualIsARGB(Visual * vis);
int ECompMgrIsActive(void);
int ECompMgrDeskConfigure(struct _desk *dsk);
int ECompMgrDeskConfigure(Desk * dsk);
void ECompMgrWinNew(EObj * eo);
void ECompMgrWinDel(EObj * eo);
@ -49,8 +48,7 @@ void ECompMgrWinMap(EObj * eo);
void ECompMgrWinUnmap(EObj * eo);
void ECompMgrWinMoveResize(EObj * eo, int change_xy,
int change_wh, int change_bw);
void ECompMgrWinReparent(EObj * eo, struct _desk *dsk,
int change_xy);
void ECompMgrWinReparent(EObj * eo, Desk * dsk, int change_xy);
void ECompMgrWinRaise(EObj * eo);
void ECompMgrWinLower(EObj * eo);
void ECompMgrWinChangeShape(EObj * eo);

View File

@ -23,7 +23,7 @@
#ifndef _EOBJ_H_
#define _EOBJ_H_
struct _desk;
#include "etypes.h"
typedef struct _eobj EObj;
@ -33,7 +33,7 @@ struct _eobj
short type; /* Ewin, button, other, ... */
short ilayer; /* Internal stacking layer */
short layer; /* Stacking layer */
struct _desk *desk; /* Belongs on desk */
Desk *desk; /* Belongs on desk */
int x, y;
int w, h;
signed char stacked;
@ -166,7 +166,7 @@ int EobjListStackLower(EObj * eo);
int EobjListStackCheck(EObj * eo);
EObj *EobjListStackFind(Window win);
EObj *const *EobjListStackGet(int *num);
EObj *const *EobjListStackGetForDesk(int *num, struct _desk *dsk);
EObj *const *EobjListStackGetForDesk(int *num, Desk * dsk);
void EobjListFocusAdd(EObj * eo, int ontop);
void EobjListFocusDel(EObj * eo);
int EobjListFocusRaise(EObj * eo);

56
src/etypes.h Normal file
View File

@ -0,0 +1,56 @@
/*
* Copyright (C) 2000-2006 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2006 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _ETYPES_H_
#define _ETYPES_H_
/*
* Opaque types
*/
typedef struct _background Background;
typedef struct _border Border;
typedef struct _button Button;
typedef struct _desk Desk;
typedef struct _ecursor ECursor;
typedef struct _ewin EWin;
typedef struct _ewinbit EWinBit;
typedef struct _group Group;
typedef struct _action Action;
typedef struct _actionclass ActionClass;
typedef struct _imageclass ImageClass;
typedef struct _imagestate ImageState;
typedef struct _textclass TextClass;
typedef struct _textstate TextState;
typedef struct _snapshot Snapshot;
#endif /* _ETYPES_H_ */

View File

@ -25,18 +25,9 @@
#define _EWIN_H_
#include "eobj.h"
#include "etypes.h"
#include "xwin.h"
struct _border;
struct _ewinbit;
struct _desk;
struct _group;
struct _snapshot;
#if 0
typedef struct _ewin EWin;
#endif
/* Window operation sources */
#define OPSRC_UNKNOWN 0
#define OPSRC_APP 1
@ -71,10 +62,10 @@ struct _ewin
char type;
Window win_container;
const struct _border *border;
const struct _border *normal_border;
const struct _border *previous_border;
struct _ewinbit *bits;
const Border *border;
const Border *normal_border;
const Border *previous_border;
EWinBit *bits;
struct
{
@ -227,7 +218,7 @@ struct _ewin
} update;
int num_groups;
struct _group **groups;
Group **groups;
int area_x, area_y;
char *session_id;
PmapMask mini_pmm;
@ -236,7 +227,7 @@ struct _ewin
int shape_x, shape_y, shape_w, shape_h;
int req_x, req_y;
struct _snapshot *snap;
Snapshot *snap;
int head; /* Unused? */
int vx, vy; /* Position in virtual root */
@ -318,7 +309,7 @@ void EwinBorderGetSize(const EWin * ewin, int *bl, int *br,
void EwinBorderUpdateState(EWin * ewin);
int EwinIsOnScreen(const EWin * ewin);
void EwinRememberPositionSet(EWin * ewin);
void EwinRememberPositionGet(EWin * ewin, struct _desk *dsk,
void EwinRememberPositionGet(EWin * ewin, Desk * dsk,
int *px, int *py);
unsigned int EwinFlagsEncode(const EWin * ewin);
void EwinFlagsDecode(EWin * ewin, unsigned int flags);
@ -329,7 +320,7 @@ void EwinChange(EWin * ewin, unsigned int flag);
void EwinsEventsConfigure(int mode);
void EwinsSetFree(void);
void EwinsShowDesktop(int on);
void EwinsMoveStickyToDesk(struct _desk *d);
void EwinsMoveStickyToDesk(Desk * d);
/* ewin-ops.c */
void SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty,
@ -342,11 +333,10 @@ void EwinResize(EWin * ewin, int w, int h);
void EwinMoveResize(EWin * ewin, int x, int y, int w, int h);
void EwinMoveResizeWithGravity(EWin * ewin, int x, int y, int w,
int h, int grav);
void EwinMoveToDesktop(EWin * ewin, struct _desk *d);
void EwinMoveToDesktopAt(EWin * ewin, struct _desk *d, int x,
int y);
void EwinMoveToDesktop(EWin * ewin, Desk * d);
void EwinMoveToDesktopAt(EWin * ewin, Desk * d, int x, int y);
void EwinFloatAt(EWin * ewin, int x, int y);
void EwinUnfloatAt(EWin * ewin, struct _desk *d, int x, int y);
void EwinUnfloatAt(EWin * ewin, Desk * d, int x, int y);
void EwinIconify(EWin * ewin);
void EwinDeIconify(EWin * ewin);
void EwinInstantShade(EWin * ewin, int force);
@ -373,7 +363,7 @@ void EwinOpShade(EWin * ewin, int source, int on);
void EwinOpSetLayer(EWin * ewin, int source, int layer);
void EwinOpSetBorder(EWin * ewin, int source, const char *name);
void EwinOpSetOpacity(EWin * ewin, int source, int opacity);
void EwinOpMoveToDesk(EWin * ewin, int source, struct _desk *dsk,
void EwinOpMoveToDesk(EWin * ewin, int source, Desk * dsk,
int inc);
void EwinOpFullscreen(EWin * ewin, int source, int on);
@ -394,7 +384,7 @@ void MaxHeight(EWin * ewin, const char *resize_type);
/* stacking.c */
EWin *const *EwinListStackGet(int *num);
EWin *const *EwinListFocusGet(int *num);
EWin *const *EwinListGetForDesk(int *num, struct _desk *d);
EWin *const *EwinListGetForDesk(int *num, Desk * d);
EWin *const *EwinListOrderGet(int *num);
EWin *EwinListStackGetTop(void);
int EwinListStackIsRaised(const EWin * ewin);

View File

@ -41,7 +41,7 @@
#define FX_OP_STOP 2
#define FX_OP_TOGGLE 3
typedef struct _fxhandler
typedef struct
{
const char *name;
void (*init_func) (const char *name);
@ -196,7 +196,7 @@ static Window fx_raindrops_win = None;
static int fx_raindrops_number = 4;
static PixImg *fx_raindrops_draw = NULL;
typedef struct _drop_context
typedef struct
{
int x, y;
int count;

View File

@ -40,8 +40,6 @@
#define GROUP_ACTION_SET_WINDOW_BORDER 8
#define GROUP_ACTION_RAISE_LOWER 9
typedef struct _group Group;
typedef struct _groupconfig
{
char iconify;

View File

@ -33,7 +33,7 @@
#include "xwin.h"
#if ENABLE_COLOR_MODIFIERS
typedef struct _modcurve
typedef struct
{
int num;
unsigned char *px;
@ -42,7 +42,7 @@ typedef struct _modcurve
}
ModCurve;
typedef struct _colormodifierclass
typedef struct
{
char *name;
ModCurve red, green, blue;
@ -67,7 +67,7 @@ struct _imagestate
#endif
};
typedef struct _ImageStateArray
typedef struct
{
ImageState *normal;
ImageState *hilited;

View File

@ -25,14 +25,9 @@
#define _ICLASS_H
#include "eimage.h"
#include "etypes.h"
#include "xwin.h"
struct _textclass;
struct _textstate;
typedef struct _imageclass ImageClass;
typedef struct _imagestate ImageState;
#define BEVEL_NONE 0
#define BEVEL_AMIGA 1
#define BEVEL_MOTIF 2
@ -126,7 +121,7 @@ EImage *ImageclassGetImageBlended(ImageClass * ic, Window win,
int image_type);
void ITApply(Window win, ImageClass * ic, ImageState * is, int w,
int h, int state, int active, int sticky,
char expose, int image_type, struct _textclass *tc,
struct _textstate *ts, const char *text);
char expose, int image_type, TextClass * tc,
TextState * ts, const char *text);
#endif /* _ICLASS_H */

View File

@ -24,7 +24,7 @@
#ifndef _MENUS_H_
#define _MENUS_H_
struct _imageclass;
#include "etypes.h"
typedef struct _menu Menu;
typedef struct _menuitem MenuItem;
@ -43,7 +43,7 @@ void MenuDestroy(Menu * m);
void MenuHide(Menu * m);
void MenuEmpty(Menu * m, int destroying);
void MenuRepack(Menu * m);
MenuItem *MenuItemCreate(const char *text, struct _imageclass *ic,
MenuItem *MenuItemCreate(const char *text, ImageClass * ic,
const char *action_params, Menu * child);
void MenuSetInternal(Menu * m);
void MenuSetDynamic(Menu * m);

View File

@ -181,7 +181,7 @@ void
MWM_SetInfo(void)
{
Atom a1;
struct _mwminfo
struct
{
long flags;
Window win;

View File

@ -23,7 +23,7 @@
#ifndef _SNAPS_H_
#define _SNAPS_H_
typedef struct _snapshot Snapshot;
#include "etypes.h"
#define SNAP_MATCH_TITLE (1 << 0)
#define SNAP_MATCH_NAME (1 << 1)

View File

@ -24,13 +24,9 @@
#ifndef _TCLASS_H
#define _TCLASS_H
#include "etypes.h"
#include "xwin.h"
struct _imageclass;
typedef struct _textclass TextClass;
typedef struct _textstate TextState;
#define MODE_VERBATIM 0
#define MODE_WRAP_CHAR 1
#define MODE_WRAP_WORD 2
@ -82,7 +78,7 @@ void TextclassDecRefcount(TextClass * tc);
int TextclassGetJustification(TextClass * tc);
void TextclassSetJustification(TextClass * tc, int just);
TextClass *TextclassFind(const char *name, int fallback);
void TextclassApply(struct _imageclass *ic, Window win, int w,
void TextclassApply(ImageClass * ic, Window win, int w,
int h, int active, int sticky, int state,
char expose, TextClass * tclass,
const char *text);

View File

@ -24,16 +24,16 @@
#ifndef _TOOLTIPS_H_
#define _TOOLTIPS_H_
struct _actionclass;
#include "etypes.h"
typedef struct _tooltip ToolTip;
typedef struct _actionclass *(CB_GetAclass) (void *data);
typedef ActionClass *(CB_GetAclass) (void *data);
int TooltipConfigLoad(FILE * fs);
void TooltipShow(ToolTip * tt, const char *text,
struct _actionclass *ac, int x, int y);
ActionClass * ac, int x, int y);
void TooltipHide(ToolTip * tt);
ToolTip *TooltipFind(const char *name);