Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BasedOnStyle: Google
AlwaysBreakAfterReturnType: All
AllowShortIfStatementsOnASingleLine: false
AlignAfterOpenBracket: AlwaysBreak
AlignAfterOpenBracket: BlockIndent
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Attach
Expand Down
9 changes: 6 additions & 3 deletions src/Tk/_tkmini.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ typedef struct Tcl_Command_ *Tcl_Command;
typedef void *ClientData;

typedef int(Tcl_CmdProc)(
ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]);
ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]
);
typedef void(Tcl_CmdDeleteProc)(ClientData clientData);

/* Typedefs derived from function signatures in Tcl header */
Expand All @@ -90,7 +91,8 @@ typedef Tcl_Command (*Tcl_CreateCommand_t)(
const char *cmdName,
Tcl_CmdProc *proc,
ClientData clientData,
Tcl_CmdDeleteProc *deleteProc);
Tcl_CmdDeleteProc *deleteProc
);
/* Tcl_AppendResult */
typedef void (*Tcl_AppendResult_t)(Tcl_Interp *interp, ...);

Expand Down Expand Up @@ -127,7 +129,8 @@ typedef int (*Tk_PhotoPutBlock_t)(
int y,
int width,
int height,
int compRule);
int compRule
);
/* Tk_FindPhoto */
typedef Tk_PhotoHandle (*Tk_FindPhoto_t)(Tcl_Interp *interp, const char *imageName);
/* Tk_PhotoGetImage */
Expand Down
24 changes: 16 additions & 8 deletions src/Tk/tkImaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,16 @@ ImagingFind(const char *name) {

static int
PyImagingPhotoPut(
ClientData clientdata, Tcl_Interp *interp, int argc, const char **argv) {
ClientData clientdata, Tcl_Interp *interp, int argc, const char **argv
) {
Imaging im;
Tk_PhotoHandle photo;
Tk_PhotoImageBlock block;

if (argc != 3) {
TCL_APPEND_RESULT(
interp, "usage: ", argv[0], " destPhoto srcImage", (char *)NULL);
interp, "usage: ", argv[0], " destPhoto srcImage", (char *)NULL
);
return TCL_ERROR;
}

Expand Down Expand Up @@ -128,22 +130,25 @@ PyImagingPhotoPut(
block.pixelPtr = (unsigned char *)im->block;

TK_PHOTO_PUT_BLOCK(
interp, photo, &block, 0, 0, block.width, block.height, TK_PHOTO_COMPOSITE_SET);
interp, photo, &block, 0, 0, block.width, block.height, TK_PHOTO_COMPOSITE_SET
);

return TCL_OK;
}

static int
PyImagingPhotoGet(
ClientData clientdata, Tcl_Interp *interp, int argc, const char **argv) {
ClientData clientdata, Tcl_Interp *interp, int argc, const char **argv
) {
Imaging im;
Tk_PhotoHandle photo;
Tk_PhotoImageBlock block;
int x, y, z;

if (argc != 3) {
TCL_APPEND_RESULT(
interp, "usage: ", argv[0], " srcPhoto destImage", (char *)NULL);
interp, "usage: ", argv[0], " srcPhoto destImage", (char *)NULL
);
return TCL_ERROR;
}

Expand Down Expand Up @@ -183,13 +188,15 @@ TkImaging_Init(Tcl_Interp *interp) {
"PyImagingPhoto",
PyImagingPhotoPut,
(ClientData)0,
(Tcl_CmdDeleteProc *)NULL);
(Tcl_CmdDeleteProc *)NULL
);
TCL_CREATE_COMMAND(
interp,
"PyImagingPhotoGet",
PyImagingPhotoGet,
(ClientData)0,
(Tcl_CmdDeleteProc *)NULL);
(Tcl_CmdDeleteProc *)NULL
);
}

/*
Expand Down Expand Up @@ -394,7 +401,8 @@ _func_loader(void *lib) {
}
return (
(TK_PHOTO_PUT_BLOCK = (Tk_PhotoPutBlock_t)_dfunc(lib, "Tk_PhotoPutBlock")) ==
NULL);
NULL
);
}

int
Expand Down
Loading