First of all: thanks for doing this, Iain!
On Tue, 30 Oct 2012 at 5:29:46 +0000, Iain Patterson wrote:
> Subject: [PATCH 1/3] AppIcon helper functions.
>
> Create wAppIconFor() and wAppIconTouchesHead() to match wWindowFor()
> and wWindowTouchesHead(). These functions will allow us to locate the
> window and head associated with a particular app icon or dock icon.
> +WAppIcon *wAppIconFor(Window window)
> +{
> + WObjDescriptor *desc;
> +
> + if (window == None)
> + return NULL;
> +
> + if (XFindContext(dpy, window, wWinContext, (XPointer *) & desc) ==
> XCNOENT)
> + return NULL;
> +
> + if (desc->parent_type == WCLASS_APPICON || desc->parent_type ==
> WCLASS_DOCK_ICON)
> + return desc->parent;
> +
> + return NULL;
> +}
Perhaps it's just me, but I can't really get what the function does
from just reading its name: wAppIconFor(). I'm no native speaker, but
the "For" suffix confuses me. I wonder if wAppIconOf() would be more
"correct" -- ignoring the CamelCase issue :-)
I think there is a better name which clearly states its purpose.
I'm bad in choosing names, though.
I guess that justifies having some comment on top of the function
to state its purpose? I know it's a small function, but I find it
nicer to have an overview of what the function is supposed to do
before reading it.
--
To unsubscribe, send mail to [email protected].