示例#1
0
void MainLoop(Object *win)
{
  ULONG signals, portmask;

  SetAttrs(win, MUIA_Window_Open, TRUE, TAG_END);
  portmask = 1 << Port->mp_SigBit;

  while (DoMethod(App, MUIM_Application_NewInput, (ULONG)&signals) != (ULONG)MUIV_Application_ReturnID_Quit)
  {
    if (signals)
    {
      signals = Wait(signals | portmask | SIGBREAKF_CTRL_C);
      if (signals & portmask)
      {
	struct SysLogPacket *slp;

	while (slp = (struct SysLogPacket*)GetMsg(Port))
        {
		if (slp->Level != LOG_CLOSE)
		{
			DoMethod(List, MUIM_List_InsertSingle, (ULONG)slp, MUIV_List_Insert_Bottom);
			DoMethod(List, MUIM_List_Jump, MUIV_List_Jump_Bottom, TAG_END);
		}
		ReplyMsg(&slp->Msg);
        }
      }
      if (signals & SIGBREAKF_CTRL_C) break;
    }
  }

  SetAttrs(win, MUIA_Window_Open, FALSE, TAG_END);
  return;
}
示例#2
0
/*************
 * DESCRIPTION:   this method is called whenever the user presses return in
 *    the float string object
 * INPUT:         cl       class
 *                obj      object
 *                msg      message
 * OUTPUT:
 *************/
static ULONG StringAck(struct IClass *cl,Object *obj,struct opGet *msg)
{
    struct Float_Data *data = (struct Float_Data *)INST_DATA(cl,obj);
    char *s;
    float value;
    char buffer[32];

    GetAttr(MUIA_String_Contents,data->fs_gadget,(ULONG*)&s);

    value = atof(s);
    if(data->lowerbound && (((value < data->lower) && data->lowerinside) || ((value <= data->lower) && !data->lowerinside)))
    {
        value = data->value;
        Float2String(value, buffer);
        SetAttrs(data->fs_gadget, MUIA_String_Contents, buffer, TAG_DONE);
        DisplayBeep(_screen(obj));
    }
    if(data->upperbound && (((value > data->upper) && data->upperinside) || ((value >= data->upper) && !data->upperinside)))
    {
        value = data->value;
        Float2String(value, buffer);
        SetAttrs(data->fs_gadget, MUIA_String_Contents, buffer, TAG_DONE);
        DisplayBeep(_screen(obj));
    }
    data->value = value;

    return 0;
}
示例#3
0
/******************************************************************
 The email list view has a new active element
*******************************************************************/
static void person_email_list_active(struct Person_Data **pdata)
{
	struct Person_Data *data = *pdata;
	char *email;
	DoMethod(data->email_list, MUIM_NList_GetEntry, MUIV_NList_GetEntry_Active, &email);
	if (email)
	{
		set(data->rem_button, MUIA_Disabled, FALSE);

		SetAttrs(data->email_string,
			MUIA_Disabled, FALSE,
			MUIA_String_Contents, email,
			MUIA_NoNotify, TRUE,
			TAG_DONE);

		set(data->wnd, MUIA_Window_ActiveObject, data->email_string);
	} else
	{
		set(data->rem_button, MUIA_Disabled, TRUE);
		SetAttrs(data->email_string,
			MUIA_Disabled, TRUE,
			MUIA_String_Contents, "",
			MUIA_NoNotify, TRUE,
			TAG_DONE);
	}
}
示例#4
0
文件: menu.c 项目: ysei/NetSurf
/* Menu refresh for hotlist */
void ami_menu_refresh(struct gui_window_2 *gwin)
{
	SetAttrs(gwin->objects[OID_MAIN],
			WINDOW_NewMenu, NULL,
			TAG_DONE);

	ami_free_menulabs(gwin);
	ami_create_menu(gwin);

	SetAttrs(gwin->objects[OID_MAIN],
			WINDOW_NewMenu, gwin->menu,
			TAG_DONE);
}
示例#5
0
/**
 * Implementation of OM_NEW
 *
 * @param cl the class
 * @param obj the object
 * @param msg the parameter of the method
 * @return
 */
STATIC ULONG AddressGroupList_New(struct IClass *cl,Object *obj,struct opSet *msg)
{
	struct AddressGroupList_Data *data;

	if (!(obj=(Object *)DoSuperNew(cl,obj,
					TAG_MORE,msg->ops_AttrList)))
		return 0;

	data = (struct AddressGroupList_Data*)INST_DATA(cl,obj);

	init_hook(&data->construct_hook,(HOOKFUNC)addressgroup_construct);
	init_hook(&data->compare_hook,(HOOKFUNC)addressgroup_compare);
	init_hook(&data->destruct_hook,(HOOKFUNC)addressgroup_destruct);
	init_hook_with_data(&data->display_hook,(HOOKFUNC)addressgroup_display, data);

	SetAttrs(obj,
						MUIA_NList_ConstructHook2, &data->construct_hook,
						MUIA_NList_CompareHook2, &data->compare_hook,
						MUIA_NList_DestructHook2, &data->destruct_hook,
						MUIA_NList_DisplayHook2, &data->display_hook,
						MUIA_NList_Title, TRUE,
						MUIA_NList_Format, ",",
						TAG_DONE);

	return (ULONG)obj;
}
示例#6
0
/*************
 * DESCRIPTION:   destructor
 * INPUT:         none
 * OUTPUT:        none
 *************/
SURFACE::~SURFACE()
{
	TEXTURE *tnext;
	BRUSH *bnext;

#ifdef __AMIGA__
	// close dialog
	SetAttrs(win, MUIA_Window_Open, FALSE, TAG_DONE);
	DoMethod(app, OM_REMMEMBER, win);
	MUI_DisposeObject(win);
#endif

	while(texture)
	{
		tnext = (TEXTURE*)texture->GetNext();
		delete texture;
		texture = tnext;
	}

	while(brush)
	{
		bnext = (BRUSH*)brush->GetNext();
		delete brush;
		brush = bnext;
	}

	if(name)
		delete name;
}
示例#7
0
void error_add_message(char *msg)
{
	if (!error_wnd) init_error();
	if (error_wnd)
	{
		struct error_node *enode = (struct error_node*)malloc(sizeof(struct error_node));
		if (enode)
		{
			if ((enode->text = mystrdup(msg)))
			{
				static char error_label[32];

				set(text_list, MUIA_NList_Quiet, TRUE);
				DoMethod(text_list, MUIM_NList_Clear);
				DoMethod(text_list, MUIM_NList_InsertSingleWrap, (ULONG)enode->text, MUIV_NList_Insert_Bottom, WRAPCOL0, ALIGN_LEFT);
				set(text_list, MUIA_NList_Quiet, FALSE);

				list_insert_tail(&error_list, &enode->node);

				sprintf(error_label, "Error %%ld/%d",list_length(&error_list));

				SetAttrs(error_numeric,
						MUIA_Numeric_Min, 1,
						MUIA_Numeric_Max, list_length(&error_list),
						MUIA_Numeric_Value, list_length(&error_list),
						MUIA_Numeric_Format, error_label,
						TAG_DONE);
			} else free(enode);
		}

		set(error_wnd, MUIA_Window_Open, TRUE);
	}
}
示例#8
0
static ULONG Req( UBYTE *gadgets, UBYTE *body, ... ) {
  struct EasyStruct req = {
    sizeof (struct EasyStruct), 0, NULL, NULL, NULL
  };
  ULONG rc;

  req.es_Title        = (char *) msgTextProgramName;
  req.es_TextFormat   = body; 
  req.es_GadgetFormat = gadgets;

  SetAttrs( WO_Window, WA_BusyPointer, TRUE, TAG_DONE);
 	rc = EasyRequestArgs( Window, &req, NULL, ( ULONG * )( &body + 1 ) );
  SetAttrs( WO_Window, WA_BusyPointer, FALSE, TAG_DONE);

  return rc;
}
示例#9
0
static void myStringOpenListview( Class *cl, Object *obj, struct gpInput *msg )
{
struct myStringClassData *data;
struct Gadget *gad;

	data = INST_DATA( cl, obj );

	gad = (struct Gadget *)obj;

	SetAttrs( data->WindowObject,
		WA_CustomScreen, msg->gpi_GInfo->gi_Window->WScreen,
		WA_Left,	data->WinXPos,
		WA_Top,		data->WinYPos,
		WA_Width,	data->WinWidth,
		WA_Height,	data->WinHeight,
		TAG_END
	);

//	  IDoMethod( data->WindowObject, WM_RETHINK );

	data->Window = (struct Window *)IDoMethod( data->WindowObject, WM_OPEN );

	if ( data->Window == NULL )
	{
		goto bailout;
	}

//	  GetAttr( WINDOW_SigMask, MainWindowObject, &MainWindowBits );

bailout:

	return;
}
示例#10
0
/*************
 * DESCRIPTION:   OM_SET method
 * INPUT:         cl       class
 *                obj      object
 *                msg      message
 * OUTPUT:
 *************/
static ULONG Set(struct IClass *cl,Object *obj,struct opSet *msg)
{
    struct Float_Data *data = (struct Float_Data *)INST_DATA(cl,obj);
    struct TagItem *tags,*tag;
    char buffer[32];

    tags=msg->ops_AttrList;
    do
    {
        tag = WARPOS_PPC_FUNC(NextTagItem)(&tags);
        if(tag)
        {
            switch (tag->ti_Tag)
            {
            case MUIA_Float_Value:
                data->value = *(float*)tag->ti_Data;
                Float2String(data->value, buffer);
                SetAttrs(data->fs_gadget, MUIA_String_Contents, buffer, TAG_DONE);
                break;
            }
        }
    }
    while(tag);

    return(DoSuperMethodA(cl,obj,(Msg)msg));
}
示例#11
0
static void SetColSpecs(SW_IDATA *idata)
{
   SetAttrs(idata->SWA_NNews_ArtListCol,
            SWA_ListCol_ColSpecs, SWGetUL(idata->ArtLst, SWA_NArticleList_ColSpecs),
            SWA_ListCol_ColNames, SWGetUL(idata->ArtLst, SWA_NArticleList_ColNames),
            SWA_ListCol_FixWidth, FALSE,
            TAG_DONE);
}
示例#12
0
Object *obutton(ULONG text, ULONG help)
{
    Object *obj;

    if((obj = MUI_MakeObject(MUIO_Button, (ULONG)getString(text))) != NULL)
        SetAttrs(obj,MUIA_CycleChain,TRUE,_HELP(help),TAG_DONE);

    return obj;
}
示例#13
0
STATIC APTR MakeCycle(LONG label, CONST CONST_STRPTR *entries, ULONG id)
{
    APTR obj = MUI_MakeObject(MUIO_Cycle, (IPTR)GSI(label), (IPTR)entries);

    if (obj)
        SetAttrs(obj, MUIA_CycleChain, 1, MUIA_ObjectID, id, TAG_DONE);

    return obj;
}
示例#14
0
STATIC APTR MakeButton(LONG str_id)
{
	APTR	obj;

	if ((obj = MUI_MakeObject(MUIO_Button, GSI(str_id))))
		SetAttrs(obj, MUIA_CycleChain, TRUE, TAG_DONE);

	return obj;
}
示例#15
0
Object *ocheckmark(ULONG key, ULONG help)
{
    Object *obj;

    if((obj = MUI_MakeObject(MUIO_Checkmark, (ULONG)getString(key))) != NULL)
        SetAttrs(obj,MUIA_CycleChain,TRUE,_HELP(help),TAG_DONE);

    return obj;
}
示例#16
0
STATIC APTR MakeString(LONG str_id, ULONG maxlen, ULONG object_id)
{
	APTR	obj;

	if ((obj = MUI_MakeObject(MUIO_String, (IPTR)GSI(str_id), maxlen)))
		SetAttrs(obj, MUIA_CycleChain, TRUE, MUIA_ObjectID, object_id, TAG_DONE);

	return obj;
}
示例#17
0
static void
ami_history_global_menu_free(struct ami_history_global_window *history_win)
{
	SetAttrs(history_win->core.objects[GID_CW_WIN],
		WINDOW_MenuStrip, NULL,
	TAG_DONE);
	
	ami_menu_free_menu(history_win->menu_data, AMI_HISTORY_M_LAST, history_win->imenu);
}
示例#18
0
Object *opopbutton(ULONG img, ULONG help)
{
    Object *obj;

    if((obj = MUI_MakeObject(MUIO_PopButton, img)) != NULL)
        SetAttrs(obj,MUIA_CycleChain,TRUE,_HELP(help),TAG_DONE);

    return obj;
}
示例#19
0
Object *
ocheck(ULONG key,ULONG help)
{
    register Object *obj;

    if (obj = MUI_MakeObject(MUIO_Checkmark,(ULONG)getString(key)))
        SetAttrs(obj,MUIA_CycleChain,TRUE,MUIA_ShortHelp,(ULONG)getString(help),TAG_DONE);

    return obj;
}
示例#20
0
文件: muiobjs.c 项目: diegocr/YGRip
Object * IntegerStringObj( STRPTR ShortHelp, ULONG ObjectID, ULONG String_MaxLen )
{
	Object * obj;
	
	if((obj = StringObj( ShortHelp, ObjectID, String_MaxLen )))
	{
		SetAttrs( obj,
			MUIA_String_Integer	, 0,
			MUIA_String_Accept	, (ULONG)"0123456789",
		TAG_DONE);
	}
	
	return obj;
}
示例#21
0
LONG SettingsHook(void)
{
#else
AROS_UFH3(
    void, SettingsHook,
    AROS_UFHA(struct Hook *,    hook,   A0),
    AROS_UFHA(APTR *,           obj,    A2),
    AROS_UFHA(APTR,             param,  A1)
)
{
    AROS_USERFUNC_INIT
#endif

    // Get data
  SetAttrs(Win, MUIA_Window_Sleep, TRUE, TAG_END);
  MainLoop(SWin);
  SetAttrs(Win, MUIA_Window_Sleep, FALSE, TAG_END);
#if !defined(__AROS__)
  return 0;
#else
    AROS_USERFUNC_EXIT
#endif
}
示例#22
0
void
TestDataStructuresChild::Test17()
{
    Attrs attrs;
    attrs.common() = CommonAttrs(true);
    attrs.specific() = BarAttrs(1.0f);

    InfallibleTArray<Op> ops;
    ops.AppendElement(SetAttrs(NULL, mKids[0], attrs));

    if (!SendTest17(ops))
        fail("sending Test17");

    printf("  passed %s\n", __FUNCTION__);
}
示例#23
0
STATIC APTR MakeCheck(LONG str_id, ULONG check, ULONG object_id)
{
	APTR obj;

	obj = MUI_MakeObject(MUIO_Checkmark, (IPTR)GSI(str_id));

	if (obj)
		SetAttrs(obj,
			MUIA_CycleChain, TRUE,
			MUIA_ObjectID  , object_id,
			MUIA_Selected  , check,
			TAG_DONE);

	return (obj);
}
示例#24
0
文件: muiobjs.c 项目: diegocr/YGRip
Object * CheckMarkObj( STRPTR ShortHelp, ULONG ObjectID )
{
	Object *obj;
	
	if((obj = MUI_MakeObject(MUIO_Checkmark, NULL)))
	{
		SetAttrs(obj,
			MUIA_CycleChain	, TRUE,
			MUIA_ShortHelp	, (ULONG)ShortHelp,
			MUIA_ObjectID	, ObjectID,
		TAG_DONE);
	}
	
	return(obj);
}
示例#25
0
文件: muiobjs.c 项目: diegocr/YGRip
Object * ButtonObj( STRPTR label, LONG FixWidth, STRPTR ShortHelp )
{
	Object *obj;
	
	if((obj = MUI_MakeObject(MUIO_Button, label )))
	{
		SetAttrs(obj,
			MUIA_CycleChain , 1,
			MUIA_FixWidth   , FixWidth,
			MUIA_ShortHelp  , (ULONG) ShortHelp,
		TAG_DONE);
	}
	
	return(obj);
}
示例#26
0
文件: muiobjs.c 项目: diegocr/YGRip
Object * CycleObj( char **array, STRPTR ShortHelp, ULONG ObjectID )
{
	Object *obj;
	
	if((obj = MUI_MakeObject(MUIO_Cycle, NULL, array)))
	{
		SetAttrs(obj,
			MUIA_CycleChain	, TRUE,
			MUIA_ShortHelp	, (ULONG) ShortHelp,
			MUIA_ObjectID	, ObjectID,
		TAG_DONE);
	}
	
	return(obj);
}
示例#27
0
STATIC APTR MakeSlider(LONG str_id, LONG fmt_id, LONG min, LONG max, ULONG object_id)
{
	APTR	obj;

	if ((obj = MUI_MakeObject(MUIO_Slider, (IPTR)GSI(str_id), min, max)))
	{
		SetAttrs(obj,
			MUIA_CycleChain		, TRUE,
			MUIA_ObjectID			, object_id,
			MUIA_Numeric_Format	, (IPTR)GSI(fmt_id),
			TAG_DONE);
	}

	return obj;
}
示例#28
0
文件: muiobjs.c 项目: diegocr/YGRip
Object * SliderObj( LONG min, LONG max, LONG Current, STRPTR ShortHelp, ULONG ObjectID)
{
	Object *obj;
	
	if((obj = MUI_MakeObject(MUIO_Slider, NULL, min, max)))
	{
		SetAttrs(obj,
			MUIA_CycleChain		, TRUE,
			MUIA_ShortHelp		, (ULONG) ShortHelp,
			MUIA_Slider_Level	, Current,
			MUIA_ObjectID		, ObjectID,
		TAG_DONE);
	}
	
	return(obj);
}
示例#29
0
static void delete_messages(void)
{
	struct error_node *node;

	set(error_wnd, MUIA_Window_Open, FALSE);

	while ((node = (struct error_node *)list_remove_tail(&error_list)))
	{
		if (node->text) free(node->text);
		free(node);
	}

	SetAttrs(error_numeric,
			MUIA_Numeric_Min, 0,
			MUIA_Numeric_Max, 0,
			MUIA_Numeric_Value, 0,
			MUIA_Numeric_Format, "Error 0/0",
			TAG_DONE);
}
示例#30
0
void Sys_Video_SetGamma(void *display, unsigned short *ramps)
{
	struct display *d = display;
	int i;

	if (d->screen && d->gammaenabled)
	{
		for(i=0;i<768;i++)
		{
			d->gammatable[i] = ramps[i]>>8;
		}

		SetAttrs(d->screen,
			SA_GammaRed, d->gammatable,
			SA_GammaGreen, d->gammatable+256,
			SA_GammaBlue, d->gammatable+512,
			TAG_DONE);
	}
}