summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-02-22 13:56:32 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-02-22 13:56:32 (GMT)
commitdde89e53698859ca30c7ef441d2b64350d2a8187 (patch)
treed27aec929ff20b2ab6ba34faa14bd56439bf1d33 /win
parent18bcf9971777b9bf6d2eacd064c42f0f7e58ae47 (diff)
downloadtk-dde89e53698859ca30c7ef441d2b64350d2a8187.zip
tk-dde89e53698859ca30c7ef441d2b64350d2a8187.tar.gz
tk-dde89e53698859ca30c7ef441d2b64350d2a8187.tar.bz2
Less of that K&R or wrongly indented function header style!
Diffstat (limited to 'win')
-rw-r--r--win/stubs.c379
-rw-r--r--win/tkWinMenu.c263
-rw-r--r--win/tkWinWindow.c5
-rw-r--r--win/tkWinWm.c6
-rw-r--r--win/ttkWinMonitor.c40
-rw-r--r--win/ttkWinXPTheme.c123
6 files changed, 433 insertions, 383 deletions
diff --git a/win/stubs.c b/win/stubs.c
index 5fbc8d1..678b176 100644
--- a/win/stubs.c
+++ b/win/stubs.c
@@ -4,7 +4,9 @@
* Undocumented Xlib internal function
*/
-int _XInitImageFuncPtrs(XImage *image)
+int
+_XInitImageFuncPtrs(
+ XImage *image)
{
return 0;
}
@@ -14,18 +16,18 @@ int _XInitImageFuncPtrs(XImage *image)
*/
void
-XSetWMClientMachine(display, w, text_prop)
- Display* display;
- Window w;
- XTextProperty* text_prop;
+XSetWMClientMachine(
+ Display *display,
+ Window w,
+ XTextProperty *text_prop)
{
}
Status
-XStringListToTextProperty(list, count, text_prop_return)
- char** list;
- int count;
- XTextProperty* text_prop_return;
+XStringListToTextProperty(
+ char **list,
+ int count,
+ XTextProperty *text_prop_return)
{
return (Status) NULL;
}
@@ -35,354 +37,347 @@ XStringListToTextProperty(list, count, text_prop_return)
*/
void
-XChangeProperty(display, w, property, type, format, mode, data, nelements)
- Display* display;
- Window w;
- Atom property;
- Atom type;
- int format;
- int mode;
- _Xconst unsigned char* data;
- int nelements;
+XChangeProperty(
+ Display *display,
+ Window w,
+ Atom property,
+ Atom type,
+ int format,
+ int mode,
+ _Xconst unsigned char *data,
+ int nelements)
{
}
Cursor
-XCreateGlyphCursor(display, source_font, mask_font, source_char, mask_char,
- foreground_color, background_color)
- Display* display;
- Font source_font;
- Font mask_font;
- unsigned int source_char;
- unsigned int mask_char;
- XColor* foreground_color;
- XColor* background_color;
+XCreateGlyphCursor(
+ Display *display,
+ Font source_font,
+ Font mask_font,
+ unsigned int source_char,
+ unsigned int mask_char,
+ XColor *foreground_color,
+ XColor *background_color)
{
return 1;
}
XIC
-XCreateIC()
+XCreateIC(void)
{
return NULL;
}
Cursor
-XCreatePixmapCursor(display, source, mask, foreground_color,
- background_color, x, y)
- Display* display;
- Pixmap source;
- Pixmap mask;
- XColor* foreground_color;
- XColor* background_color;
- unsigned int x;
- unsigned int y;
+XCreatePixmapCursor(
+ Display *display,
+ Pixmap source,
+ Pixmap mask,
+ XColor *foreground_color,
+ XColor *background_color,
+ unsigned int x,
+ unsigned int y)
{
return (Cursor) NULL;
}
void
-XDeleteProperty(display, w, property)
- Display* display;
- Window w;
- Atom property;
+XDeleteProperty(
+ Display *display,
+ Window w,
+ Atom property)
{
}
void
-XDestroyIC(ic)
- XIC ic;
+XDestroyIC(
+ XIC ic)
{
}
Bool
-XFilterEvent(event, window)
- XEvent* event;
- Window window;
+XFilterEvent(
+ XEvent *event,
+ Window window)
{
return 0;
}
-extern void XForceScreenSaver(display, mode)
- Display* display;
- int mode;
+void
+XForceScreenSaver(
+ Display *display,
+ int mode)
{
}
void
-XFreeCursor(display, cursor)
- Display* display;
- Cursor cursor;
+XFreeCursor(
+ Display *display,
+ Cursor cursor)
{
}
GContext
-XGContextFromGC(gc)
- GC gc;
+XGContextFromGC(
+ GC gc)
{
return (GContext) NULL;
}
char *
-XGetAtomName(display, atom)
- Display* display;
- Atom atom;
+XGetAtomName(
+ Display *display,
+ Atom atom)
{
return NULL;
}
int
-XGetWindowAttributes(display, w, window_attributes_return)
- Display* display;
- Window w;
- XWindowAttributes* window_attributes_return;
+XGetWindowAttributes(
+ Display *display,
+ Window w,
+ XWindowAttributes *window_attributes_return)
{
return 0;
}
Status
-XGetWMColormapWindows(display, w, windows_return, count_return)
- Display* display;
- Window w;
- Window** windows_return;
- int* count_return;
+XGetWMColormapWindows(
+ Display *display,
+ Window w,
+ Window **windows_return,
+ int *count_return)
{
return (Status) NULL;
}
int
-XIconifyWindow(display, w, screen_number)
- Display* display;
- Window w;
- int screen_number;
+XIconifyWindow(
+ Display *display,
+ Window w,
+ int screen_number)
{
return 0;
}
XHostAddress *
-XListHosts(display, nhosts_return, state_return)
- Display* display;
- int* nhosts_return;
- Bool* state_return;
+XListHosts(
+ Display *display,
+ int *nhosts_return,
+ Bool *state_return)
{
return NULL;
}
int
-XLookupColor(display, colormap, color_name, exact_def_return,
- screen_def_return)
- Display* display;
- Colormap colormap;
- _Xconst char* color_name;
- XColor* exact_def_return;
- XColor* screen_def_return;
+XLookupColor(
+ Display *display,
+ Colormap colormap,
+ _Xconst char *color_name,
+ XColor *exact_def_return,
+ XColor *screen_def_return)
{
return 0;
}
void
-XNextEvent(display, event_return)
- Display* display;
- XEvent* event_return;
+XNextEvent(
+ Display *display,
+ XEvent *event_return)
{
}
void
-XPutBackEvent(display, event)
- Display* display;
- XEvent* event;
+XPutBackEvent(
+ Display *display,
+ XEvent *event)
{
}
void
-XQueryColors(display, colormap, defs_in_out, ncolors)
- Display* display;
- Colormap colormap;
- XColor* defs_in_out;
- int ncolors;
+XQueryColors(
+ Display *display,
+ Colormap colormap,
+ XColor *defs_in_out,
+ int ncolors)
{
}
int
-XQueryTree(display, w, root_return, parent_return, children_return,
- nchildren_return)
- Display* display;
- Window w;
- Window* root_return;
- Window* parent_return;
- Window** children_return;
- unsigned int* nchildren_return;
+XQueryTree(
+ Display *display,
+ Window w,
+ Window *root_return,
+ Window *parent_return,
+ Window **children_return,
+ unsigned int *nchildren_return)
{
return 0;
}
void
-XRefreshKeyboardMapping(event_map)
- XMappingEvent* event_map;
+XRefreshKeyboardMapping(
+ XMappingEvent *event_map)
{
}
Window
-XRootWindow(display, screen_number)
- Display* display;
- int screen_number;
+XRootWindow(
+ Display *display,
+ int screen_number)
{
return (Window) NULL;
}
void
-XSelectInput(display, w, event_mask)
- Display* display;
- Window w;
- long event_mask;
+XSelectInput(
+ Display *display,
+ Window w,
+ long event_mask)
{
}
int
-XSendEvent(display, w, propagate, event_mask, event_send)
- Display* display;
- Window w;
- Bool propagate;
- long event_mask;
- XEvent* event_send;
+XSendEvent(
+ Display *display,
+ Window w,
+ Bool propagate,
+ long event_mask,
+ XEvent *event_send)
{
return 0;
}
void
-XSetCommand(display, w, argv, argc)
- Display* display;
- Window w;
- CONST char** argv;
- int argc;
+XSetCommand(
+ Display *display,
+ Window w,
+ CONST char **argv,
+ int argc)
{
}
XErrorHandler
-XSetErrorHandler (handler)
- XErrorHandler handler;
+XSetErrorHandler(
+ XErrorHandler handler)
{
return NULL;
}
void
-XSetIconName(display, w, icon_name)
- Display* display;
- Window w;
- _Xconst char* icon_name;
+XSetIconName(
+ Display *display,
+ Window w,
+ _Xconst char *icon_name)
{
}
void
-XSetWindowBackground(display, w, background_pixel)
- Display* display;
- Window w;
- unsigned long background_pixel;
+XSetWindowBackground(
+ Display *display,
+ Window w,
+ unsigned long background_pixel)
{
}
void
-XSetWindowBackgroundPixmap(display, w, background_pixmap)
- Display* display;
- Window w;
- Pixmap background_pixmap;
+XSetWindowBackgroundPixmap(
+ Display *display,
+ Window w,
+ Pixmap background_pixmap)
{
}
void
-XSetWindowBorder(display, w, border_pixel)
- Display* display;
- Window w;
- unsigned long border_pixel;
+XSetWindowBorder(
+ Display *display,
+ Window w,
+ unsigned long border_pixel)
{
}
void
-XSetWindowBorderPixmap(display, w, border_pixmap)
- Display* display;
- Window w;
- Pixmap border_pixmap;
+XSetWindowBorderPixmap(
+ Display *display,
+ Window w,
+ Pixmap border_pixmap)
{
}
void
-XSetWindowBorderWidth(display, w, width)
- Display* display;
- Window w;
- unsigned int width;
+XSetWindowBorderWidth(
+ Display *display,
+ Window w,
+ unsigned int width)
{
}
void
-XSetWindowColormap(display, w, colormap)
- Display* display;
- Window w;
- Colormap colormap;
+XSetWindowColormap(
+ Display *display,
+ Window w,
+ Colormap colormap)
{
}
Bool
-XTranslateCoordinates(display, src_w, dest_w, src_x, src_y, dest_x_return,
- dest_y_return, child_return)
- Display* display;
- Window src_w;
- Window dest_w;
- int src_x;
- int src_y;
- int* dest_x_return;
- int* dest_y_return;
- Window* child_return;
+XTranslateCoordinates(
+ Display *display,
+ Window src_w,
+ Window dest_w,
+ int src_x,
+ int src_y,
+ int *dest_x_return,
+ int *dest_y_return,
+ Window *child_return)
{
return 0;
}
void
-XWindowEvent(display, w, event_mask, event_return)
- Display* display;
- Window w;
- long event_mask;
- XEvent* event_return;
+XWindowEvent(
+ Display *display,
+ Window w,
+ long event_mask,
+ XEvent *event_return)
{
}
int
-XWithdrawWindow(display, w, screen_number)
- Display* display;
- Window w;
- int screen_number;
+XWithdrawWindow(
+ Display *display,
+ Window w,
+ int screen_number)
{
return 0;
}
int
-XmbLookupString(ic, event, buffer_return, bytes_buffer, keysym_return,
- status_return)
- XIC ic;
- XKeyPressedEvent* event;
- char* buffer_return;
- int bytes_buffer;
- KeySym* keysym_return;
- Status* status_return;
+XmbLookupString(
+ XIC ic,
+ XKeyPressedEvent *event,
+ char *buffer_return,
+ int bytes_buffer,
+ KeySym *keysym_return,
+ Status *status_return)
{
return 0;
}
int
-XGetWindowProperty(display, w, property, long_offset, long_length, delete,
- req_type, actual_type_return, actual_format_return, nitems_return,
- bytes_after_return, prop_return)
- Display* display;
- Window w;
- Atom property;
- long long_offset;
- long long_length;
- Bool delete;
- Atom req_type;
- Atom* actual_type_return;
- int* actual_format_return;
- unsigned long* nitems_return;
- unsigned long* bytes_after_return;
- unsigned char** prop_return;
+XGetWindowProperty(
+ Display *display,
+ Window w,
+ Atom property,
+ long long_offset,
+ long long_length,
+ Bool delete,
+ Atom req_type,
+ Atom *actual_type_return,
+ int *actual_format_return,
+ unsigned long *nitems_return,
+ unsigned long *bytes_after_return,
+ unsigned char **prop_return)
{
*actual_type_return = None;
*actual_format_return = 0;
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 9b0ec85..3d95ff5 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinMenu.c,v 1.53 2007/01/12 10:41:23 dkf Exp $
+ * RCS: @(#) $Id: tkWinMenu.c,v 1.54 2007/02/22 13:56:34 dkf Exp $
*/
#define OEMRESOURCE
@@ -182,9 +182,9 @@ static LRESULT CALLBACK TkWinEmbeddedMenuProc(HWND hwnd, UINT message,
*/
static int
-GetNewID(mePtr, menuIDPtr)
- TkMenuEntry *mePtr; /* The menu we are working with */
- WORD *menuIDPtr; /* The resulting id */
+GetNewID(
+ TkMenuEntry *mePtr, /* The menu we are working with */
+ WORD *menuIDPtr) /* The resulting id */
{
int found = 0;
int newEntry;
@@ -238,8 +238,8 @@ GetNewID(mePtr, menuIDPtr)
*/
static void
-FreeID(commandID)
- WORD commandID;
+FreeID(
+ WORD commandID)
{
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -276,8 +276,8 @@ FreeID(commandID)
*/
int
-TkpNewMenu(menuPtr)
- TkMenu *menuPtr; /* The common structure we are making the
+TkpNewMenu(
+ TkMenu *menuPtr) /* The common structure we are making the
* platform structure for. */
{
HMENU winMenuHdl;
@@ -324,8 +324,8 @@ TkpNewMenu(menuPtr)
*/
void
-TkpDestroyMenu(menuPtr)
- TkMenu *menuPtr; /* The common menu structure */
+TkpDestroyMenu(
+ TkMenu *menuPtr) /* The common menu structure */
{
HMENU winMenuHdl = (HMENU) menuPtr->platformData;
char *searchName;
@@ -406,8 +406,8 @@ TkpDestroyMenu(menuPtr)
*/
void
-TkpDestroyMenuEntry(mePtr)
- TkMenuEntry *mePtr; /* The entry to destroy */
+TkpDestroyMenuEntry(
+ TkMenuEntry *mePtr) /* The entry to destroy */
{
TkMenu *menuPtr = mePtr->menuPtr;
HMENU winMenuHdl = (HMENU) menuPtr->platformData;
@@ -442,8 +442,8 @@ TkpDestroyMenuEntry(mePtr)
*/
static char *
-GetEntryText(mePtr)
- TkMenuEntry *mePtr; /* A pointer to the menu entry. */
+GetEntryText(
+ TkMenuEntry *mePtr) /* A pointer to the menu entry. */
{
char *itemText;
@@ -718,11 +718,10 @@ ReconfigureWindowsMenu(
*/
int
-TkpPostMenu(interp, menuPtr, x, y)
- Tcl_Interp *interp;
- TkMenu *menuPtr;
- int x;
- int y;
+TkpPostMenu(
+ Tcl_Interp *interp,
+ TkMenu *menuPtr,
+ int x, int y)
{
HMENU winMenuHdl = (HMENU) menuPtr->platformData;
int i, result, flags;
@@ -837,8 +836,8 @@ TkpPostMenu(interp, menuPtr, x, y)
*/
int
-TkpMenuNewEntry(mePtr)
- TkMenuEntry *mePtr;
+TkpMenuNewEntry(
+ TkMenuEntry *mePtr)
{
WORD commandID;
TkMenu *menuPtr = mePtr->menuPtr;
@@ -876,11 +875,11 @@ TkpMenuNewEntry(mePtr)
*/
static LRESULT CALLBACK
-TkWinMenuProc(hwnd, message, wParam, lParam)
- HWND hwnd;
- UINT message;
- WPARAM wParam;
- LPARAM lParam;
+TkWinMenuProc(
+ HWND hwnd,
+ UINT message,
+ WPARAM wParam,
+ LPARAM lParam)
{
LRESULT lResult;
@@ -908,7 +907,10 @@ TkWinMenuProc(hwnd, message, wParam, lParam)
*----------------------------------------------------------------------
*/
-static void UpdateEmbeddedMenu(ClientData clientData) {
+static void
+UpdateEmbeddedMenu(
+ ClientData clientData)
+{
RECT rc;
HWND hMenuWnd = (HWND)clientData;
GetClientRect(hMenuWnd, &rc);
@@ -934,11 +936,11 @@ static void UpdateEmbeddedMenu(ClientData clientData) {
*/
static LRESULT CALLBACK
-TkWinEmbeddedMenuProc(hwnd, message, wParam, lParam)
- HWND hwnd;
- UINT message;
- WPARAM wParam;
- LPARAM lParam;
+TkWinEmbeddedMenuProc(
+ HWND hwnd,
+ UINT message,
+ WPARAM wParam,
+ LPARAM lParam)
{
static int nIdles = 0;
LRESULT lResult = 1;
@@ -1000,12 +1002,12 @@ TkWinEmbeddedMenuProc(hwnd, message, wParam, lParam)
*/
int
-TkWinHandleMenuEvent(phwnd, pMessage, pwParam, plParam, plResult)
- HWND *phwnd;
- UINT *pMessage;
- WPARAM *pwParam;
- LPARAM *plParam;
- LRESULT *plResult;
+TkWinHandleMenuEvent(
+ HWND *phwnd,
+ UINT *pMessage,
+ WPARAM *pwParam,
+ LPARAM *plParam,
+ LRESULT *plResult)
{
Tcl_HashEntry *hashEntryPtr;
int returnResult = 0;
@@ -1340,10 +1342,10 @@ RecursivelyClearActiveMenu(
*/
void
-TkpSetWindowMenuBar(tkwin, menuPtr)
- Tk_Window tkwin; /* The window we are putting the menubar
+TkpSetWindowMenuBar(
+ Tk_Window tkwin, /* The window we are putting the menubar
* into.*/
- TkMenu *menuPtr; /* The menu we are inserting */
+ TkMenu *menuPtr) /* The menu we are inserting */
{
HMENU winMenuHdl;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
@@ -1419,7 +1421,7 @@ TkpSetMainMenubar(
*/
void
-GetMenuIndicatorGeometry (
+GetMenuIndicatorGeometry(
TkMenu *menuPtr, /* The menu we are measuring */
TkMenuEntry *mePtr, /* The entry we are measuring */
Tk_Font tkfont, /* Precalculated font */
@@ -1456,7 +1458,7 @@ GetMenuIndicatorGeometry (
*/
void
-GetMenuAccelGeometry (
+GetMenuAccelGeometry(
TkMenu *menuPtr, /* The menu we are measuring */
TkMenuEntry *mePtr, /* The entry we are measuring */
Tk_Font tkfont, /* The precalculated font */
@@ -1493,7 +1495,7 @@ GetMenuAccelGeometry (
*/
void
-GetTearoffEntryGeometry (
+GetTearoffEntryGeometry(
TkMenu *menuPtr, /* The menu we are measuring */
TkMenuEntry *mePtr, /* The entry we are measuring */
Tk_Font tkfont, /* The precalculated font */
@@ -1526,7 +1528,7 @@ GetTearoffEntryGeometry (
*/
void
-GetMenuSeparatorGeometry (
+GetMenuSeparatorGeometry(
TkMenu *menuPtr, /* The menu we are measuring */
TkMenuEntry *mePtr, /* The entry we are measuring */
Tk_Font tkfont, /* The precalculated font */
@@ -1558,14 +1560,14 @@ GetMenuSeparatorGeometry (
*/
static void
-DrawWindowsSystemBitmap(display, drawable, gc, rectPtr, bitmapID, alignFlags)
- Display *display; /* The display we are drawing into */
- Drawable drawable; /* The drawable we are working with */
- GC gc; /* The GC to draw with */
- CONST RECT *rectPtr; /* The rectangle to draw into */
- int bitmapID; /* The windows id of the system bitmap to
+DrawWindowsSystemBitmap(
+ Display *display, /* The display we are drawing into */
+ Drawable drawable, /* The drawable we are working with */
+ GC gc, /* The GC to draw with */
+ CONST RECT *rectPtr, /* The rectangle to draw into */
+ int bitmapID, /* The windows id of the system bitmap to
* draw. */
- int alignFlags; /* How to align the bitmap inside the
+ int alignFlags) /* How to align the bitmap inside the
* rectangle. */
{
TkWinDCState state;
@@ -1634,19 +1636,18 @@ DrawWindowsSystemBitmap(display, drawable, gc, rectPtr, bitmapID, alignFlags)
*/
void
-DrawMenuEntryIndicator(menuPtr, mePtr, d, gc, indicatorGC, tkfont, fmPtr, x,
- y, width, height)
- TkMenu *menuPtr; /* The menu we are drawing */
- TkMenuEntry *mePtr; /* The entry we are drawing */
- Drawable d; /* What we are drawing into */
- GC gc; /* The gc we are drawing with */
- GC indicatorGC; /* The gc for indicator objects */
- Tk_Font tkfont; /* The precalculated font */
- CONST Tk_FontMetrics *fmPtr;/* The precalculated font metrics */
- int x; /* Left edge */
- int y; /* Top edge */
- int width;
- int height;
+DrawMenuEntryIndicator(
+ TkMenu *menuPtr, /* The menu we are drawing */
+ TkMenuEntry *mePtr, /* The entry we are drawing */
+ Drawable d, /* What we are drawing into */
+ GC gc, /* The gc we are drawing with */
+ GC indicatorGC, /* The gc for indicator objects */
+ Tk_Font tkfont, /* The precalculated font */
+ CONST Tk_FontMetrics *fmPtr,/* The precalculated font metrics */
+ int x, /* Left edge */
+ int y, /* Top edge */
+ int width,
+ int height)
{
if ((mePtr->type == CHECK_BUTTON_ENTRY)
|| (mePtr->type == RADIO_BUTTON_ENTRY)) {
@@ -1779,18 +1780,17 @@ DrawMenuEntryAccelerator(
*/
void
-DrawMenuEntryArrow(menuPtr, mePtr, d, gc, activeBorder, x, y, width, height,
- drawArrow)
- TkMenu *menuPtr; /* The menu we are drawing */
- TkMenuEntry *mePtr; /* The entry we are drawing */
- Drawable d; /* What we are drawing into */
- GC gc; /* The gc we are drawing with */
- Tk_3DBorder activeBorder; /* The border when an item is active */
- int x; /* left edge */
- int y; /* top edge */
- int width; /* Width of menu entry */
- int height; /* Height of menu entry */
- int drawArrow; /* For cascade menus, whether of not to draw
+DrawMenuEntryArrow(
+ TkMenu *menuPtr, /* The menu we are drawing */
+ TkMenuEntry *mePtr, /* The entry we are drawing */
+ Drawable d, /* What we are drawing into */
+ GC gc, /* The gc we are drawing with */
+ Tk_3DBorder activeBorder, /* The border when an item is active */
+ int x, /* left edge */
+ int y, /* top edge */
+ int width, /* Width of menu entry */
+ int height, /* Height of menu entry */
+ int drawArrow) /* For cascade menus, whether of not to draw
* the arraw. I cannot figure out Windows'
* algorithm for where to draw this. */
{
@@ -1850,17 +1850,17 @@ DrawMenuEntryArrow(menuPtr, mePtr, d, gc, activeBorder, x, y, width, height,
*/
void
-DrawMenuSeparator(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y, width, height)
- TkMenu *menuPtr; /* The menu we are drawing */
- TkMenuEntry *mePtr; /* The entry we are drawing */
- Drawable d; /* What we are drawing into */
- GC gc; /* The gc we are drawing with */
- Tk_Font tkfont; /* The precalculated font */
- CONST Tk_FontMetrics *fmPtr;/* The precalculated font metrics */
- int x; /* left edge */
- int y; /* top edge */
- int width; /* width of item */
- int height; /* height of item */
+DrawMenuSeparator(
+ TkMenu *menuPtr, /* The menu we are drawing */
+ TkMenuEntry *mePtr, /* The entry we are drawing */
+ Drawable d, /* What we are drawing into */
+ GC gc, /* The gc we are drawing with */
+ Tk_Font tkfont, /* The precalculated font */
+ CONST Tk_FontMetrics *fmPtr,/* The precalculated font metrics */
+ int x, /* left edge */
+ int y, /* top edge */
+ int width, /* width of item */
+ int height) /* height of item */
{
XPoint points[2];
Tk_3DBorder border;
@@ -1942,11 +1942,11 @@ DrawMenuUnderline(
*/
static int
-TkWinMenuKeyObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Unused. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+TkWinMenuKeyObjCmd(
+ ClientData clientData, /* Unused. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
UINT scanCode;
UINT virtualKey;
@@ -2070,9 +2070,9 @@ TkWinMenuKeyObjCmd(clientData, interp, objc, objv)
*/
void
-TkpInitializeMenuBindings(interp, bindingTable)
- Tcl_Interp *interp; /* The interpreter to set. */
- Tk_BindingTable bindingTable;
+TkpInitializeMenuBindings(
+ Tcl_Interp *interp, /* The interpreter to set. */
+ Tk_BindingTable bindingTable)
/* The table to add to. */
{
Tk_Uid uid = Tk_GetUid("all");
@@ -2325,8 +2325,8 @@ DrawMenuEntryLabel(
*/
void
-TkpComputeMenubarGeometry(menuPtr)
- TkMenu *menuPtr; /* Structure describing menu. */
+TkpComputeMenubarGeometry(
+ TkMenu *menuPtr) /* Structure describing menu. */
{
TkpComputeStandardMenuGeometry(menuPtr);
}
@@ -2348,17 +2348,15 @@ TkpComputeMenubarGeometry(menuPtr)
*/
void
-DrawTearoffEntry(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y, width, height)
- TkMenu *menuPtr; /* The menu we are drawing */
- TkMenuEntry *mePtr; /* The entry we are drawing */
- Drawable d; /* The drawable we are drawing into */
- GC gc; /* The gc we are drawing with */
- Tk_Font tkfont; /* The font we are drawing with */
- CONST Tk_FontMetrics *fmPtr;/* The metrics we are drawing with */
- int x;
- int y;
- int width;
- int height;
+DrawTearoffEntry(
+ TkMenu *menuPtr, /* The menu we are drawing */
+ TkMenuEntry *mePtr, /* The entry we are drawing */
+ Drawable d, /* The drawable we are drawing into */
+ GC gc, /* The gc we are drawing with */
+ Tk_Font tkfont, /* The font we are drawing with */
+ CONST Tk_FontMetrics *fmPtr,/* The metrics we are drawing with */
+ int x, int y,
+ int width, int height)
{
XPoint points[2];
int segmentWidth, maxX;
@@ -2405,8 +2403,8 @@ DrawTearoffEntry(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y, width, height)
*/
int
-TkpConfigureMenuEntry(mePtr)
- register TkMenuEntry *mePtr;/* Information about menu entry; may or may
+TkpConfigureMenuEntry(
+ register TkMenuEntry *mePtr)/* Information about menu entry; may or may
* not already have values for some fields. */
{
TkMenu *menuPtr = mePtr->menuPtr;
@@ -2436,19 +2434,18 @@ TkpConfigureMenuEntry(mePtr)
*/
void
-TkpDrawMenuEntry(mePtr, d, tkfont, menuMetricsPtr, x, y, width, height,
- strictMotif, drawArrow)
- TkMenuEntry *mePtr; /* The entry to draw */
- Drawable d; /* What to draw into */
- Tk_Font tkfont; /* Precalculated font for menu */
- CONST Tk_FontMetrics *menuMetricsPtr;
+TkpDrawMenuEntry(
+ TkMenuEntry *mePtr, /* The entry to draw */
+ Drawable d, /* What to draw into */
+ Tk_Font tkfont, /* Precalculated font for menu */
+ CONST Tk_FontMetrics *menuMetricsPtr,
/* Precalculated metrics for menu */
- int x; /* X-coordinate of topleft of entry */
- int y; /* Y-coordinate of topleft of entry */
- int width; /* Width of the entry rectangle */
- int height; /* Height of the current rectangle */
- int strictMotif; /* Boolean flag */
- int drawArrow; /* Whether or not to draw the cascade arrow
+ int x, /* X-coordinate of topleft of entry */
+ int y, /* Y-coordinate of topleft of entry */
+ int width, /* Width of the entry rectangle */
+ int height, /* Height of the current rectangle */
+ int strictMotif, /* Boolean flag */
+ int drawArrow) /* Whether or not to draw the cascade arrow
* for cascade items. Only applies to
* Windows. */
{
@@ -2571,12 +2568,12 @@ TkpDrawMenuEntry(mePtr, d, tkfont, menuMetricsPtr, x, y, width, height,
*/
static void
-GetMenuLabelGeometry(mePtr, tkfont, fmPtr, widthPtr, heightPtr)
- TkMenuEntry *mePtr; /* The entry we are computing */
- Tk_Font tkfont; /* The precalculated font */
- CONST Tk_FontMetrics *fmPtr;/* The precalculated metrics */
- int *widthPtr; /* The resulting width of the label portion */
- int *heightPtr; /* The resulting height of the label
+GetMenuLabelGeometry(
+ TkMenuEntry *mePtr, /* The entry we are computing */
+ Tk_Font tkfont, /* The precalculated font */
+ CONST Tk_FontMetrics *fmPtr,/* The precalculated metrics */
+ int *widthPtr, /* The resulting width of the label portion */
+ int *heightPtr) /* The resulting height of the label
* portion */
{
TkMenu *menuPtr = mePtr->menuPtr;
@@ -2978,8 +2975,8 @@ TkpMenuNotifyToplevelCreate(
*/
HWND
-Tk_GetMenuHWND(tkwin)
- Tk_Window tkwin;
+Tk_GetMenuHWND(
+ Tk_Window tkwin)
{
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -3208,7 +3205,7 @@ SetDefaults(
*/
void
-TkpMenuInit()
+TkpMenuInit(void)
{
WNDCLASS wndClass;
@@ -3254,7 +3251,7 @@ TkpMenuInit()
*/
void
-TkpMenuThreadInit()
+TkpMenuThreadInit(void)
{
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c
index 4fc6a0e..016fbb7 100644
--- a/win/tkWinWindow.c
+++ b/win/tkWinWindow.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinWindow.c,v 1.13 2007/01/11 15:35:41 dkf Exp $
+ * RCS: @(#) $Id: tkWinWindow.c,v 1.14 2007/02/22 13:56:35 dkf Exp $
*/
#include "tkWinInt.h"
@@ -250,7 +250,8 @@ TkpScanWindowId(
*/
Window
-TkpMakeWindow( TkWindow *winPtr,
+TkpMakeWindow(
+ TkWindow *winPtr,
Window parent)
{
HWND parentWin;
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 6eddb59..0935afb 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinWm.c,v 1.113 2007/01/12 10:41:23 dkf Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.114 2007/02/22 13:56:35 dkf Exp $
*/
#include "tkWinInt.h"
@@ -8161,8 +8161,8 @@ TkWinSetForegroundWindow(
*/
void
-TkpWinToplevelWithDraw(winPtr)
- TkWindow *winPtr;
+TkpWinToplevelWithDraw(
+ TkWindow *winPtr)
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
wmPtr->flags |= WM_WITHDRAWN;
diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c
index c0198d9..2f28e71 100644
--- a/win/ttkWinMonitor.c
+++ b/win/ttkWinMonitor.c
@@ -1,4 +1,4 @@
-/* $Id: ttkWinMonitor.c,v 1.7 2007/02/04 00:10:55 mistachkin Exp $
+/* $Id: ttkWinMonitor.c,v 1.8 2007/02/22 13:56:35 dkf Exp $
*/
#ifdef _MSC_VER
@@ -74,13 +74,15 @@ static void RegisterSystemColors(Tcl_Interp *interp)
}
static HWND
-CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp)
+CreateThemeMonitorWindow(
+ HINSTANCE hinst,
+ Tcl_Interp *interp)
{
WNDCLASSEX wc;
- HWND hwnd = NULL;
- CHAR title[32] = "TtkMonitorWindow";
- CHAR name[32] = "TtkMonitorClass";
-
+ HWND hwnd = NULL;
+ CHAR title[32] = "TtkMonitorWindow";
+ CHAR name[32] = "TtkMonitorClass";
+
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC)WndProc;
@@ -93,11 +95,11 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp)
wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
wc.lpszMenuName = name;
wc.lpszClassName = name;
-
+
if (RegisterClassEx(&wc)) {
- hwnd = CreateWindow( name, title, WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
- NULL, NULL, hinst, NULL );
+ hwnd = CreateWindow(name, title, WS_OVERLAPPEDWINDOW,
+ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+ NULL, NULL, hinst, NULL );
#ifdef _WIN64
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG)interp);
#else
@@ -109,15 +111,20 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp)
return hwnd;
}
-static void
-DestroyThemeMonitorWindow(void *clientData)
+static void
+DestroyThemeMonitorWindow(
+ void *clientData)
{
HWND hwnd = (HWND)clientData;
DestroyWindow(hwnd);
}
static LRESULT WINAPI
-WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
+WndProc(
+ HWND hwnd,
+ UINT msg,
+ WPARAM wp,
+ LPARAM lp)
{
#ifdef _WIN64
Tcl_Interp *interp = (Tcl_Interp *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
@@ -157,10 +164,12 @@ WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
MODULE_SCOPE int TtkWinTheme_Init(Tcl_Interp *, HWND hwnd);
MODULE_SCOPE int TtkXPTheme_Init(Tcl_Interp *, HWND hwnd);
-MODULE_SCOPE int Ttk_WinPlatformInit(Tcl_Interp *interp)
+MODULE_SCOPE int
+Ttk_WinPlatformInit(
+ Tcl_Interp *interp)
{
HWND hwnd;
-
+
hwnd = CreateThemeMonitorWindow(Tk_GetHINSTANCE(), interp);
Ttk_RegisterCleanup(interp, (ClientData)hwnd, DestroyThemeMonitorWindow);
@@ -169,4 +178,3 @@ MODULE_SCOPE int Ttk_WinPlatformInit(Tcl_Interp *interp)
return TCL_OK;
}
-
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index b166f1e..723b7d7 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -1,5 +1,5 @@
/*
- * $Id: ttkWinXPTheme.c,v 1.8 2007/02/04 00:10:55 mistachkin Exp $
+ * $Id: ttkWinXPTheme.c,v 1.9 2007/02/22 13:56:35 dkf Exp $
*
* Tk theme engine which uses the Windows XP "Visual Styles" API
* Adapted from Georgios Petasis' XP theme patch.
@@ -88,7 +88,8 @@ typedef struct
*/
static XPThemeProcs *
-LoadXPThemeProcs(HINSTANCE *phlib)
+LoadXPThemeProcs(
+ HINSTANCE *phlib)
{
OSVERSIONINFO os;
@@ -145,7 +146,8 @@ LoadXPThemeProcs(HINSTANCE *phlib)
*/
static void
-XPThemeDeleteProc(void *clientData)
+XPThemeDeleteProc(
+ void *clientData)
{
XPThemeData *themeData = clientData;
FreeLibrary(themeData->hlibrary);
@@ -153,7 +155,9 @@ XPThemeDeleteProc(void *clientData)
}
static int
-XPThemeEnabled(Ttk_Theme theme, void *clientData)
+XPThemeEnabled(
+ Ttk_Theme theme,
+ void *clientData)
{
XPThemeData *themeData = clientData;
int active = themeData->procs->IsThemeActive();
@@ -166,7 +170,8 @@ XPThemeEnabled(Ttk_Theme theme, void *clientData)
* Helper routine. Returns a RECT data structure.
*/
static RECT
-BoxToRect(Ttk_Box b)
+BoxToRect(
+ Ttk_Box b)
{
RECT rc;
rc.top = b.y;
@@ -406,7 +411,9 @@ typedef struct
} ElementData;
static ElementData *
-NewElementData(XPThemeProcs *procs, ElementInfo *info)
+NewElementData(
+ XPThemeProcs *procs,
+ ElementInfo *info)
{
ElementData *elementData = (ElementData*)ckalloc(sizeof(ElementData));
@@ -417,7 +424,9 @@ NewElementData(XPThemeProcs *procs, ElementInfo *info)
return elementData;
}
-static void DestroyElementData(void *elementData)
+static void
+DestroyElementData(
+ void *elementData)
{
ckfree(elementData);
}
@@ -434,7 +443,10 @@ static void DestroyElementData(void *elementData)
*/
static int
-InitElementData(ElementData *elementData, Tk_Window tkwin, Drawable d)
+InitElementData(
+ ElementData *elementData,
+ Tk_Window tkwin,
+ Drawable d)
{
Window win = Tk_WindowId(tkwin);
@@ -460,7 +472,8 @@ InitElementData(ElementData *elementData, Tk_Window tkwin, Drawable d)
}
static void
-FreeElementData(ElementData *elementData)
+FreeElementData(
+ ElementData *elementData)
{
elementData->procs->CloseThemeData(elementData->hTheme);
if (elementData->drawable != 0) {
@@ -471,15 +484,19 @@ FreeElementData(ElementData *elementData)
/*----------------------------------------------------------------------
* +++ Generic element implementation.
- *
+ *
* Used for elements which are handled entirely by the XP Theme API,
* such as radiobutton and checkbutton indicators, scrollbar arrows, etc.
*/
static void
GenericElementGeometry(
- void *clientData, void *elementRecord, Tk_Window tkwin,
- int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+ void *clientData,
+ void *elementRecord,
+ Tk_Window tkwin,
+ int *widthPtr,
+ int *heightPtr,
+ Ttk_Padding *paddingPtr)
{
ElementData *elementData = clientData;
HRESULT result;
@@ -511,8 +528,12 @@ GenericElementGeometry(
static void
GenericElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+ void *clientData,
+ void *elementRecord,
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ unsigned int state)
{
ElementData *elementData = clientData;
RECT rc;
@@ -553,8 +574,12 @@ static Ttk_ElementSpec GenericElementSpec =
static void
ThumbElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+ void *clientData,
+ void *elementRecord,
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ unsigned int state)
{
ElementData *elementData = clientData;
unsigned stateId = Ttk_StateTableLookup(elementData->info->statemap, state);
@@ -588,12 +613,17 @@ static Ttk_ElementSpec ThumbElementSpec =
/*----------------------------------------------------------------------
* +++ Progress bar element.
* Increases the requested length of PP_CHUNK and PP_CHUNKVERT parts
- * so that indeterminate progress bars show 3 bars instead of 1.
+ * so that indeterminate progress bars show 3 bars instead of 1.
*/
-static void PbarElementGeometry(
- void *clientData, void *elementRecord, Tk_Window tkwin,
- int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+static void
+PbarElementGeometry(
+ void *clientData,
+ void *elementRecord,
+ Tk_Window tkwin,
+ int *widthPtr,
+ int *heightPtr,
+ Ttk_Padding *paddingPtr)
{
ElementData *elementData = clientData;
int nBars = 3;
@@ -621,19 +651,25 @@ static Ttk_ElementSpec PbarElementSpec =
* +++ Notebook tab element.
* Same as generic element, with additional logic to select
* proper iPartID for the leftmost tab.
- *
- * Notes: TABP_TABITEMRIGHTEDGE (or TABP_TOPTABITEMRIGHTEDGE,
+ *
+ * Notes: TABP_TABITEMRIGHTEDGE (or TABP_TOPTABITEMRIGHTEDGE,
* which appears to be identical) should be used if the
* tab is exactly at the right edge of the notebook, but
* not if it's simply the rightmost tab. This information
* is not available.
*
- * The TIS_* and TILES_* definitions are identical, so
+ * The TIS_* and TILES_* definitions are identical, so
* we can use the same statemap no matter what the partId.
*/
-static void TabElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+
+static void
+TabElementDraw(
+ void *clientData,
+ void *elementRecord,
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ unsigned int state)
{
ElementData *elementData = clientData;
int partId = elementData->info->partId;
@@ -667,7 +703,7 @@ static Ttk_ElementSpec TabElementSpec =
#define TTK_STATE_OPEN TTK_STATE_USER1
#define TTK_STATE_LEAF TTK_STATE_USER2
-static Ttk_StateTable header_statemap[] =
+static Ttk_StateTable header_statemap[] =
{
{ HIS_PRESSED, TTK_STATE_PRESSED, 0 },
{ HIS_HOT, TTK_STATE_ACTIVE, 0 },
@@ -680,9 +716,14 @@ static Ttk_StateTable tvpglyph_statemap[] =
{ GLPS_CLOSED, 0,0 },
};
-static void TreeIndicatorElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+static void
+TreeIndicatorElementDraw(
+ void *clientData,
+ void *elementRecord,
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ unsigned int state)
{
if (!(state & TTK_STATE_LEAF)) {
GenericElementDraw(clientData,elementRecord,tkwin,d,b,state);
@@ -704,11 +745,11 @@ static Ttk_ElementSpec TreeIndicatorElementSpec =
*----------------------------------------------------------------------
* Text element (does not work yet).
*
- * According to "Using Windows XP Visual Styles", we need to select
+ * According to "Using Windows XP Visual Styles", we need to select
* a font into the DC before calling DrawThemeText().
* There's just no easy way to get an HFONT out of a Tk_Font.
* Maybe GetThemeFont() would work?
- *
+ *
*/
typedef struct
@@ -728,8 +769,12 @@ static Ttk_ElementOptionSpec TextElementOptions[] =
static void
TextElementGeometry(
- void *clientData, void *elementRecord, Tk_Window tkwin,
- int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+ void *clientData,
+ void *elementRecord,
+ Tk_Window tkwin,
+ int *widthPtr,
+ int *heightPtr,
+ Ttk_Padding *paddingPtr)
{
TextElement *element = elementRecord;
ElementData *elementData = clientData;
@@ -760,10 +805,14 @@ TextElementGeometry(
FreeElementData(elementData);
}
-static void
+static void
TextElementDraw(
- ClientData clientData, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+ ClientData clientData,
+ void *elementRecord,
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ unsigned int state)
{
TextElement *element = elementRecord;
ElementData *elementData = clientData;