Ejemplo n.º 1
0
void create_buttons() {

	
	container_outer = edje_object_add(evas);
	edje_object_file_set(container_outer, default_theme, "widgets/scrollframe");
	evas_object_move(container_outer, 0, 0);
	edje_object_signal_emit(container_outer, "hbar", "hide");
	evas_object_resize(container_outer, barwidth - 19, container_height);
	evas_object_show(container_outer);

	edje_object_signal_callback_add(container_outer, "drag*", "vbar_bar", _scrolldrag, NULL);
	
	container = esmart_container_new(evas);
	edje_object_part_swallow(container_outer, "item", container);
	esmart_container_direction_set(container, CONTAINER_DIRECTION_VERTICAL);
	
	get_theme_list();

#define ADD_BUTTON(A, B, C)\
	A = edje_object_add(evas);\
	edje_object_file_set(A, default_theme, "widgets/button");\
	evas_object_resize(A, 120, 24);\
	edje_object_part_text_set(A, "label", C);\
	evas_object_show(A);
	
	ADD_BUTTON(b_default, 40, "Default Theme");
	evas_object_move(b_default, 5, container_height + 10);
	edje_object_signal_callback_add(b_default, "click", "", _preview_theme, NULL);
	 
	ADD_BUTTON(b_apply, 60, "Apply");
	evas_object_move(b_apply, 5, container_height + 40);
	edje_object_signal_callback_add(b_apply, "click", "", _set_theme, NULL);
	
	ADD_BUTTON(b_exit, 80, "Exit");
	evas_object_move(b_exit, 5, container_height + 60);
	edje_object_signal_callback_add(b_exit, "click", "", _ethemes_exit, NULL);
	

#undef ADD_BUTTON
}
Ejemplo n.º 2
0
NTSTATUS
    HGM_Game2HID
    (
    IN  OUT PUHIDGAME_INPUT_DATA    pHIDData,
    IN PDEVICE_OBJECT       DeviceObject
    )
{
    #define ADD_BUTTON(a, b) ((((a)>0) & (map[(b)] < 16)) ? botones[map[(b)]] : 0 )
    int Id = 1, i;
    NTSTATUS            ntStatus = STATUS_SUCCESS;
    HIDGAME_INPUT_DATA  LocalBuffer;
    PDEVICE_EXTENSION   DeviceExtension;
    PUCHAR map;
    PUCHAR finder;
    PUCHAR axismap;

    DeviceExtension = GET_MINIDRIVER_DEVICE_EXTENSION(DeviceObject);
    RtlZeroMemory( &LocalBuffer, sizeof( LocalBuffer ) );

    if(DeviceExtension->psx.ScanMode == 0) 
      KeSetEvent(&(DeviceExtension->DoScan), 0, FALSE);
    else
      DeviceExtension->querystill++;

    ntStatus = DeviceExtension->psx.laststatus;
    map = DeviceExtension->psx.buttonmap;

    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.box, 0);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.cross, 1);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.circle, 2);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.triangle, 3);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.l1, 4);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.r1, 5);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.l2, 6);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.r2, 7);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.select, 8);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.start, 9);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.l3, 10);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.r3, 11);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.lf, 12);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.dn, 13);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.rt, 14);
    LocalBuffer.Buttons |= ADD_BUTTON(DeviceExtension->psx.up, 15);

    if(DeviceExtension->psx.Psx2) {
      finder = (PUCHAR) &(DeviceExtension->psx);
      for(i=0; i<16; i++)
      {
        switch(map[i])
        {
             case 16:
               LocalBuffer.AnalogButtons[0] = ((-1) * (256+finder[i]))+511;
               break;
             case 17:
               LocalBuffer.AnalogButtons[1] = ((-1) * (256+finder[i]))+511;
               break;
             case 18:
               LocalBuffer.AnalogButtons[2] = ((-1) * (256+finder[i]))+511;
               break;
             case 19:
               LocalBuffer.AnalogButtons[3] = ((-1) * (256+finder[i]))+511;
               break;
        }
      }
    };

    axismap = (PUCHAR) &DeviceExtension->psx.Ejes;

    LocalBuffer.Axis[axismap[0]] = DeviceExtension->psx.lx;
    LocalBuffer.Axis[axismap[1]] = DeviceExtension->psx.ly;
    LocalBuffer.Axis[axismap[2]] = DeviceExtension->psx.ry;
    LocalBuffer.Axis[axismap[3]] = DeviceExtension->psx.rx;

    for(i=0;i<4; i++)
      if((LocalBuffer.Axis[i] >= DeviceExtension->psx.min) &&
           (LocalBuffer.Axis[i] <= DeviceExtension->psx.max))
         LocalBuffer.Axis[i] = 127;
    C_ASSERT( sizeof( *pHIDData ) == sizeof( LocalBuffer ) );
    RtlCopyMemory( pHIDData, &LocalBuffer, sizeof( LocalBuffer ) );

    return ntStatus;

} /* HGM_Game2HID */
Ejemplo n.º 3
0
CPanelAlerts::CPanelAlerts(wxWindow *parent, wxWindowID id) :
  wxPanel(parent,id)
{
  {
    CParmOsirisGlobal px;
    int n = px->GetShowAlerts();
    m_ViewStatus.Set(n);
  }
  wxStaticText *pLabel = new wxStaticText(this,wxID_ANY,"Notices");
  mainApp::SetBoldFont(pLabel);
  m_pButtonAll = 
    CreateToggleButton("All",0,
    "Show all notices or hold down the shift key to hide all notices");
  wxToggleButton *pButtonDIRECTORY =
    CreateToggleButton(
      "Dir",
      CAlertViewStatus::DIRECTORY,
      "Show or hide directory notices");
  wxToggleButton *pButtonDIRECTORY_LOCUS =
    CreateToggleButton(
      "Dir Locus",
      CAlertViewStatus::DIRECTORY_LOCUS,
      "Show or hide directory level locus notices");
  wxToggleButton *pButtonSAMPLE = 
    CreateToggleButton(
      "Sample",
      CAlertViewStatus::SAMPLE,
      "Show or hide sample level notices");
  wxToggleButton *pButtonCHANNEL =
    CreateToggleButton(
      "Channel",
      CAlertViewStatus::CHANNEL,
      "Show or hide channel notices for current sample");
  wxToggleButton *pButtonILS =
    CreateToggleButton(
      "ILS",
      CAlertViewStatus::ILS,
      "Show or hide ILS notices for current sample");
  wxToggleButton *pButtonSAMPLE_LOCUS =
    CreateToggleButton(
      "Locus",
      CAlertViewStatus::SAMPLE_LOCUS,
      "Show or hide locus notices for current sample");
  _InitFromStatus();
  wxBoxSizer *pSizer(new wxBoxSizer(wxHORIZONTAL));

#ifdef __WXMAC__
#define LABEL_FLAG wxALIGN_CENTRE_VERTICAL | wxBOTTOM
#define BUTTON_FLAG LABEL_FLAG | wxLEFT
#else
#define LABEL_FLAG wxALIGN_CENTRE_VERTICAL | wxBOTTOM | wxLEFT | wxTOP
#define BUTTON_FLAG LABEL_FLAG 
#endif

  pSizer->Add(
    pLabel,0,
    LABEL_FLAG,
    ID_BORDER);

#define ADD_BUTTON(x) \
  pSizer->Add         \
  (x,0,               \
   BUTTON_FLAG,       \
   ID_BORDER)

  ADD_BUTTON(m_pButtonAll);
  ADD_BUTTON(pButtonDIRECTORY);
  ADD_BUTTON(pButtonDIRECTORY_LOCUS);
  ADD_BUTTON(pButtonSAMPLE);
  ADD_BUTTON(pButtonCHANNEL);
  ADD_BUTTON(pButtonILS);
  ADD_BUTTON(pButtonSAMPLE_LOCUS);
  pSizer->AddStretchSpacer(1);
  SetSizer(pSizer);
  Layout();
}
Ejemplo n.º 4
0
// *****************************************************************************
NTSTATUS  INTERNAL
    HGM_GetFeature
    (
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP Irp
    )
{
    NTSTATUS            ntStatus = STATUS_SUCCESS;
    PDEVICE_EXTENSION   DeviceExtension;
    PIO_STACK_LOCATION  IrpStack;
    extern const int botones[];
    int prev;
    HGM_DBGPRINT(FILE_IOCTL | HGM_FENTRY,\
                   ("HGM_ReadReport(DeviceObject=0x%x,Irp=0x%x)", \
                    DeviceObject, Irp));

    /*
     * Get a pointer to the device extension.
     */

    DeviceExtension = GET_MINIDRIVER_DEVICE_EXTENSION (DeviceObject);

    /*
     * Get Stack location.
     */

    IrpStack = IoGetCurrentIrpStackLocation(Irp);

    /*
     * First check the size of the output buffer (there is no input buffer)
     */
    if( ((HID_XFER_PACKET*)Irp->UserBuffer)->reportBufferLen < 7 )
    {
        ntStatus = STATUS_BUFFER_TOO_SMALL;
    }

    if( DeviceExtension->fStarted == FALSE )
    {
        ntStatus = STATUS_DEVICE_NOT_READY ;
    }

    /*
     *  All the checking done so do device specific polling
     */
    if( NT_SUCCESS(ntStatus) )
    {
        PUCHAR ReportBuffer;
        unsigned short *Buttons;
        ReportBuffer = ((HID_XFER_PACKET*)Irp->UserBuffer)->reportBuffer;
        if(DeviceExtension->fetscan)
        {
          KeClearEvent(&(DeviceExtension->ScanReady));
          prev = DeviceExtension->psx.noAx;
          DeviceExtension->psx.noAx = 1;
          KeSetEvent(&(DeviceExtension->DoScan), 0, FALSE);
          KeWaitForSingleObject(&(DeviceExtension->ScanReady), UserRequest, KernelMode, FALSE, 0);
          DeviceExtension->psx.noAx = prev;
        };
        DeviceExtension->fetscan = 0;
        Buttons = (unsigned short*)ReportBuffer;
        #define ADD_BUTTON(a, b) (((a)>0) ? botones[(b)] : 0)
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.box, 0);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.cross, 1);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.circle, 2);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.triangle, 3);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.l1, 4);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.r1, 5);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.l2, 6);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.r2, 7);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.select, 8);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.start, 9);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.l3, 10);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.r3, 11);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.lf, 12);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.dn, 13);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.rt, 14);
        *Buttons |= ADD_BUTTON(DeviceExtension->psx.up, 15);
        ReportBuffer[2] = (UCHAR)DeviceExtension->DeviceID;
        ReportBuffer[3] = DeviceExtension->psx.lx;
        ReportBuffer[4] = DeviceExtension->psx.ly;
        Irp->IoStatus.Information = 8;
    } 
    else
    {
        Irp->IoStatus.Information = 0x0;
    }

    Irp->IoStatus.Status = ntStatus;


    HGM_EXITPROC(FILE_IOCTL|HGM_FEXIT,  "HGM_ReadReport", ntStatus);

    return ntStatus;
} /* HGM_ReadReport */