On Fri, Nov 27, 2009 at 05:49:09PM +0000, Przemysław Firszt wrote:
> Dnia 2009-11-22, nie o godzinie 14:05 -0800, Ping pisze:
> 
> > However, this is an open source project. You can provide a guideline
> > for us or share your suggestions with us. We are more than happy to
> > accept any contributions to the project, especially for
> > xf86-input-wacom, which bears our future. We want, by all means, to
> > make it easier for others to contribue to linuxwacom project.
> 
> OK, here is first sketch of proposed changes in the structure of the
> driver:
> 
> wcmCommon.c   -  contains all funcions required for handling a tablet
> (receiving, handling, sending events), but not for
> initializing/opening/closing/configuring tablet or manipulating data).
> xf86WcmOpen should be in xf86Wacom.c
> 
> wcmCompat.c   - DELETE. xf86WcmWait to be moved to wcmISDV4.c (it's used
> only there) xf86WcmReady be moved to wcmWacom.c (it's used only there)
> 
> wcmConfig.c   - allocating device, initialising, plugging, unplugging,
> uninitialising. xf86WcmPointInArea, xf86WcmAreasOverlap,
> xf86WcmAreaListOverlap should be moved to wcmCommon

these xf86* functions are wrongly named, they're not X interface functions
and should be renamed to wcm*. after the move, that is (see end of email).
 
> wcmFilter.c   - data filtering (like pressure curve functions or jitter
> correction, tilt2rotation)
> 
> wcmFilter.h   - header file for wcmFilter.c
> 
> wcmISDV4.c    - Wacom IV protocol specific functions
> 
> wcmTilt2Rotation.c    - DELETE. Function xf86WcmTilt2R to be moved to
> wcmFilter, tiltTable to go to wcmFilter.h
> 
> wcmUSB.c      - USB specific functions. WacomModel definitions to be moved to
> a new wcmUSB.h header file. Another option is to create wcmConfig.h           
> and
> drop all USB and ISDV4 definitions there.
> 
> wcmValidateDevice.c   - probing, parsing, checking for duplicate device
> 
> wcmXCommand.c - Mode switching and screen changing functions,
> xf86WcmSetProperty and InitWcmDeviceProperties to be moved to
> xf86Config.c 

IMO, wcmXCommand.c is a confusing name as it is. we could just rename it to
wcmProperties.c and move the other stuff (which is a mere 100 LOC or so)
into xf86Wacom.c

> xf86Wacom.c   - opening, closing device, change control. Option 2: merge
> xf86Wacom with wcmConfig. xf86WcmRegisterX11Devices to be moved to
> wcmConfig.c and xf86WcmIsWacomDevice to wcmValidateDevice.c

I think xf86Wacom.c should only contain the interface to the X server: the
module data, driver hooks to initialize, set up and remove the driver, etc.
No wacom-specific internal data.
this is hopefully in Ping's best interest as well, as that should be the
only file that changes when the X API or ABI changes and most if not all ABI
ifdefs should be in that file only.
the rest of the code can then be better shared with linuxwacom.

> My goal is to create a logical structure, easy to understand by a
> newcomer. A next thing is that if you, lets say, want to check some USB
> functions you don't need to see all the properties of all USB tablets
> (even nicely folded by vim), that's why I added a separate header file
> with the definitions. I'm sure it can be done better, so I'm open to all
> suggestions. 

git is good at detecting moved content, including maintaining the
git blame history. i.e. if you run git blame on file it'll give you the
history across the move.

This works as long as you move the code as-is and then change it later - I
recommend doing exactly this. Don't be tempted to fix up whitespaces or
even bugs when you copy from A to B, put it as a separate patch on top of
the move.
(note that fixing bugs during a janitorial cleanup such as this is a big
no-no in any project anyway).

The plan itself sounds good, though though I recommend not doing everything
in one go but rather in small patches, one-by-one. 
intrusive stuff like this is hard to slot in and a merge would be a
nightmare to bisect. the smaller the patches, the easier we can just slot
them in between the others and the easier the conflict resolution on rebases.
I really want to avoid a merge commit for this.

Ping - how does that sound to you?
 
Cheers,
  Peter

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to