diff options
Diffstat (limited to 'generic/ttk/ttkManager.h')
-rw-r--r-- | generic/ttk/ttkManager.h | 52 |
1 files changed, 10 insertions, 42 deletions
diff --git a/generic/ttk/ttkManager.h b/generic/ttk/ttkManager.h index c03c3da..550fe62 100644 --- a/generic/ttk/ttkManager.h +++ b/generic/ttk/ttkManager.h @@ -1,10 +1,8 @@ -/* $Id: ttkManager.h,v 1.5 2007/01/11 14:49:47 jenglish Exp $ +/* $Id: ttkManager.h,v 1.6 2007/06/09 21:45:44 jenglish Exp $ * * Copyright (c) 2005, Joe English. Freely redistributable. * - * Ttk widget set: Geometry management utilities. - * - * TODO: opacify data structures. + * Geometry manager utilities. */ #ifndef _TTKMANAGER @@ -12,8 +10,7 @@ #include "ttkTheme.h" -typedef struct TtkManager_ Ttk_Manager; /* forward */ -typedef struct TtkSlave_ Ttk_Slave; /* forward */ +typedef struct TtkManager_ Ttk_Manager; /* * Geometry manager specification record: @@ -23,24 +20,16 @@ typedef struct TtkSlave_ Ttk_Slave; /* forward */ * PlaceSlaves sets the position and size of all managed slaves * by calling Ttk_PlaceSlave(). * - * SlaveAdded() is called after a new slave has been added. - * * SlaveRemoved() is called immediately before a slave is removed. * NB: the associated slave window may have been destroyed when this * routine is called. */ typedef struct { /* Manager hooks */ Tk_GeomMgr tkGeomMgr; /* "real" Tk Geometry Manager */ - Tk_OptionSpec *slaveOptionSpecs; /* slave record options */ - size_t slaveSize; /* size of slave record */ int (*RequestedSize)(void *managerData, int *widthPtr, int *heightPtr); void (*PlaceSlaves)(void *managerData); - - void (*SlaveAdded)(Ttk_Manager *, int slaveIndex); void (*SlaveRemoved)(Ttk_Manager *, int slaveIndex); - int (*SlaveConfigured)( - Tcl_Interp *, Ttk_Manager *, Ttk_Slave *, unsigned mask); } Ttk_ManagerSpec; /* @@ -49,25 +38,6 @@ typedef struct { /* Manager hooks */ MODULE_SCOPE void Ttk_GeometryRequestProc(ClientData, Tk_Window slave); MODULE_SCOPE void Ttk_LostSlaveProc(ClientData, Tk_Window slave); -struct TtkSlave_ -{ - Tk_Window slaveWindow; - Ttk_Manager *manager; - void *slaveData; - unsigned flags; /* private; see manager.c */ -}; - -struct TtkManager_ -{ - Ttk_ManagerSpec *managerSpec; - void *managerData; - Tk_Window masterWindow; - Tk_OptionTable slaveOptionTable; - unsigned flags; /* private; see manager.c */ - int nSlaves; - Ttk_Slave **slaves; -}; - /* * Public API: */ @@ -75,16 +45,11 @@ MODULE_SCOPE Ttk_Manager *Ttk_CreateManager( Ttk_ManagerSpec *, void *managerData, Tk_Window masterWindow); MODULE_SCOPE void Ttk_DeleteManager(Ttk_Manager *); -MODULE_SCOPE int Ttk_AddSlave( - Tcl_Interp *, Ttk_Manager *, Tk_Window, int position, - int objc, Tcl_Obj *CONST objv[]); +MODULE_SCOPE void Ttk_InsertSlave( + Ttk_Manager *, int position, Tk_Window, void *slaveData); MODULE_SCOPE void Ttk_ForgetSlave(Ttk_Manager *, int slaveIndex); -MODULE_SCOPE int Ttk_ConfigureSlave( - Tcl_Interp *interp, Ttk_Manager *, Ttk_Slave *, - int objc, Tcl_Obj *CONST objv[]); - MODULE_SCOPE void Ttk_ReorderSlave(Ttk_Manager *, int fromIndex, int toIndex); /* Rearrange slave positions */ @@ -104,7 +69,7 @@ MODULE_SCOPE void Ttk_ManagerLayoutChanged(Ttk_Manager *); MODULE_SCOPE int Ttk_SlaveIndex(Ttk_Manager *, Tk_Window); /* Returns: index in slave array of specified window, -1 if not found */ -MODULE_SCOPE Ttk_Slave *Ttk_GetSlaveFromObj( +MODULE_SCOPE int Ttk_GetSlaveIndexFromObj( Tcl_Interp *, Ttk_Manager *, Tcl_Obj *, int *indexPtr); /* Accessor functions: @@ -112,8 +77,11 @@ MODULE_SCOPE Ttk_Slave *Ttk_GetSlaveFromObj( MODULE_SCOPE int Ttk_NumberSlaves(Ttk_Manager *); /* Returns: number of managed slaves */ +MODULE_SCOPE void *Ttk_ManagerData(Ttk_Manager *); + /* Returns: client data associated with master */ + MODULE_SCOPE void *Ttk_SlaveData(Ttk_Manager *, int slaveIndex); - /* Returns: private data associated with slave */ + /* Returns: client data associated with slave */ MODULE_SCOPE Tk_Window Ttk_SlaveWindow(Ttk_Manager *, int slaveIndex); /* Returns: slave window */ |