lockelements.c File Reference


Detailed Description

Unlocking/locking elements plug-in for PCB.

Author:
Copyright (C) 2008, 2009 by Bert Timmerman <bert.timmerman@xs4all.nl>
Function to lock all or a selection of PCB elements.
Locked elements can all be unlocked in the same instance.

Compile like this:

gcc -Ipath/to/pcb/src -Ipath/to/pcb -O2 -shared lockelements.c -o lockelements.so

The resulting lockelements.so file should go in $HOME/.pcb/plugins/

Warning:
Be very strict in compiling this plug-in against the exact pcb sources you compiled/installed the pcb executable (i.e. src/pcb) with.
Usage: LockElements([Selected|All])
Usage: UnlockElements(All)

If no argument is passed, no locking/unlocking of elements is carried out.

Bug:
When locking a selection of elements, it is not easy to unselect the selection since those elements and their pins/pads/elementlines/elementarcs are now locked ;)
This may be thought of as understandable at first, but may also be considered to be a bug in pcb.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to:
the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Definition in file lockelements.c.

#include <stdio.h>
#include <math.h>
#include "global.h"
#include "data.h"
#include "hid.h"
#include "misc.h"
#include "create.h"
#include "rtree.h"
#include "undo.h"
#include "set.h"
#include "error.h"

Include dependency graph for lockelements.c:

Go to the source code of this file.

Functions

static int lock_elements (int argc, char **argv, int x, int y)
 Locking all or selected elements.
static int unlock_elements (int argc, char **argv, int x, int y)
 Locking all or selected elements.
void pcb_plugin_init ()

Variables

static HID_Action lockelements_action_list []


Function Documentation

static int lock_elements int  argc,
char **  argv,
int  x,
int  y
[static]
 

Locking all or selected elements.

Usage:
LockElements([Selected|All])
LE([Selected|All])
If no argument is passed, no action is carried out.

Definition at line 69 of file lockelements.c.

static int unlock_elements int  argc,
char **  argv,
int  x,
int  y
[static]
 

Locking all or selected elements.

Usage:
UnlockElements(All)
UE(All)
If no argument is passed, no action is carried out.

Definition at line 117 of file lockelements.c.


Variable Documentation

HID_Action lockelements_action_list[] [static]
 

Initial value:

{
        {"LockElements", NULL, lock_elements, "Lock selected or all elements", NULL},
        {"LE", NULL, lock_elements, "Lock selected or all elements", NULL},
        {"UnlockElements", NULL, unlock_elements, "Unlock selected or all elements", NULL},
        {"UE", NULL, unlock_elements, "Unlock selected or all elements", NULL}
}

Definition at line 144 of file lockelements.c.


Generated on Tue Aug 17 15:28:06 2010 for pcb-plugins by  doxygen 1.4.6-NO