[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: rat not connected, can't find it



> On Thu, Apr 10, 2008 at 9:54 AM, DJ Delorie <dj@xxxxxxxxxxx> wrote:
> >  Oh crap, now  I'm going to have to write it.
> 
> And now I'm going to have upgrade ;-)

Wrote it.  http://www.delorie.com/pcb/findrat.c

#include <stdio.h>
#include <math.h>

#include "global.h"
#include "data.h"
#include "hid.h"
#include "error.h"

static int
findrat (int argc, char **argv, int x, int y)
{
  RatType *r;

  if (PCB->Data->RatN == 0)
    {
      Message("No Rats");
      return 0;
    }

  r = & (PCB->Data->Rat[0]);
  gui->set_crosshair (r->Point1.X, r->Point1.Y, HID_SC_PAN_VIEWPORT);
  return 0;
}

static HID_Action findrat_action_list[] = {
  {"FindRat", NULL, findrat,
   NULL, NULL}
};

REGISTER_ACTIONS (findrat_action_list)

void
pcb_plugin_init()
{
  register_findrat_action_list();
}


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user