Esempio n. 1
0
File: ui.c Progetto: russells/hc2
static QState uiMenuSettimeHours(struct UI *me)
{
	switch (Q_SIG(me)) {
	case Q_ENTRY_SIG:
		lcd_buttons(LCD_BUTTONS_ALL);
		me->settime_YmdHM = 'H';
		display_set_time(me, TRUE, TRUE);
		QActive_armX((QActive*)me, 1, 17);
		return Q_HANDLED();
	case Q_TIMEOUT1_SIG:
		return Q_TRAN(uiMenuSettimeHoursFlash);
	case BUTTON_ENTER_PRESS_SIGNAL:
		ACTION();
		return Q_TRAN(uiMenuSettimeMinutes);
	case BUTTON_UP_PRESS_SIGNAL:
	case BUTTON_UP_LONG_PRESS_SIGNAL:
	case BUTTON_UP_REPEAT_SIGNAL:
		ACTION();
		inc_hour(&me->settime);
		display_set_time(me, TRUE, TRUE);
		QActive_armX((QActive*)me, 1, 17);
		return Q_HANDLED();
	case BUTTON_DOWN_PRESS_SIGNAL:
	case BUTTON_DOWN_LONG_PRESS_SIGNAL:
	case BUTTON_DOWN_REPEAT_SIGNAL:
		ACTION();
		dec_hour(&me->settime);
		display_set_time(me, TRUE, TRUE);
		QActive_armX((QActive*)me, 1, 17);
		return Q_HANDLED();
	}
	return Q_SUPER(uiMenu);
}
Esempio n. 2
0
File: ui.c Progetto: russells/hc2
static QState uiMenuCalibrate(struct UI *me)
{
	switch (Q_SIG(me)) {
	case Q_ENTRY_SIG:
		SERIALSTR("uiMenuCalibrate\r\n");
		me->temperatureWaits = 0;
		me->cal = BSP_get_calibration();
		me->ti = INVALIDTI;
		show_temperature_cal(me);
		if (me->cal >= MAX_CAL) {
			lcd_buttons(LCD_BUTTONS_ENTER_DOWN_CANCEL);
		} else if (me->cal <= MIN_CAL) {
			lcd_buttons(LCD_BUTTONS_ENTER_UP_CANCEL);
		} else {
			lcd_buttons(LCD_BUTTONS_ALL);
		}
		return Q_HANDLED();
	case BUTTON_ENTER_PRESS_SIGNAL:
		ACTION();
		SERIALSTR("b1\r\n");
		set_calibration(me->cal);
		return Q_TRAN(uiMenuMaybeCalibrate);
	case BUTTON_UP_PRESS_SIGNAL:
		ACTION();
		if (me->cal < MAX_CAL) {
			SERIALSTR("up\r\n");
			lcd_buttons(LCD_BUTTONS_ALL);
			me->cal ++;
			if (me->cal < MAX_CAL) {
				lcd_buttons(LCD_BUTTONS_ALL);
			} else {
				lcd_buttons(LCD_BUTTONS_ENTER_DOWN_CANCEL);
			}
			show_temperature_cal(me);
		}
		return Q_HANDLED();
	case BUTTON_DOWN_PRESS_SIGNAL:
		ACTION();
		if (me->cal > MIN_CAL) {
			SERIALSTR("down\r\n");
			lcd_buttons(LCD_BUTTONS_ALL);
			me->cal --;
			if (me->cal > MIN_CAL) {
				lcd_buttons(LCD_BUTTONS_ALL);
			} else {
				lcd_buttons(LCD_BUTTONS_ENTER_UP_CANCEL);
			}
			show_temperature_cal(me);
		}
		return Q_HANDLED();
	case Q_EXIT_SIG:
		/* Save this as an invalid value, so at the next tick
		   uiGetTemperature() will be forced to update the display. */
		me->ti = INVALIDTI;
		return Q_HANDLED();
	}
	return Q_SUPER(uiMenu);
}
void
e_cal_shell_view_memopad_actions_update (ECalShellView *cal_shell_view)
{
	ECalShellContent *cal_shell_content;
	EShellWindow *shell_window;
	EShellView *shell_view;
	EMemoTable *memo_table;
	GtkAction *action;
	GSList *list, *iter;
	gboolean editable = TRUE;
	gboolean has_url = FALSE;
	gboolean sensitive;
	gint n_selected;

	shell_view = E_SHELL_VIEW (cal_shell_view);
	shell_window = e_shell_view_get_shell_window (shell_view);

	cal_shell_content = cal_shell_view->priv->cal_shell_content;
	memo_table = e_cal_shell_content_get_memo_table (cal_shell_content);

	n_selected = e_table_selected_count (E_TABLE (memo_table));

	list = e_memo_table_get_selected (memo_table);
	for (iter = list; iter != NULL; iter = iter->next) {
		ECalModelComponent *comp_data = iter->data;
		icalproperty *prop;
		gboolean read_only;

		read_only = e_client_is_readonly (E_CLIENT (comp_data->client));
		editable &= !read_only;

		prop = icalcomponent_get_first_property (
			comp_data->icalcomp, ICAL_URL_PROPERTY);
		has_url |= (prop != NULL);
	}
	g_slist_free (list);

	action = ACTION (CALENDAR_MEMOPAD_FORWARD);
	sensitive = (n_selected == 1);
	gtk_action_set_sensitive (action, sensitive);

	action = ACTION (CALENDAR_MEMOPAD_OPEN);
	sensitive = (n_selected == 1);
	gtk_action_set_sensitive (action, sensitive);

	action = ACTION (CALENDAR_MEMOPAD_OPEN_URL);
	sensitive = (n_selected == 1) && has_url;
	gtk_action_set_sensitive (action, sensitive);

	action = ACTION (CALENDAR_MEMOPAD_PRINT);
	sensitive = (n_selected == 1);
	gtk_action_set_sensitive (action, sensitive);

	action = ACTION (CALENDAR_MEMOPAD_SAVE_AS);
	sensitive = (n_selected == 1);
	gtk_action_set_sensitive (action, sensitive);
}
Esempio n. 4
0
static void handle_sleep(struct sched_state *s)
{
	if (ACTION(s, sleeping) && !HANDLING_INTERRUPT(s)) {
		lsprintf(DEV, "agent %d sleep -- ", s->cur_agent->tid);
		print_qs(DEV, s);
		printf(DEV, "\n");
		agent_sleep(s);
		/* it doesn't quite matter where this flag gets turned off, but
		 * there are two places where it can get woken up (wake/unsleep)
		 * so may as well do it here. */
		ACTION(s, sleeping) = false;
	}
}
Esempio n. 5
0
void moduleAdmin::actionSetup() {

	static const Actions actions[256] =  {
		//	00
		ACTION( "admin_Nop",		a_Nop),
		ACTION( "admin_Nop",		a_Nop),
		ACTION( "admin_Nop",		a_Nop),
		ACTION( "admin_Nop",		a_Nop)
		// 04

	};

	_actions = actions;
}
Esempio n. 6
0
void moduleAuth::actionSetup() {

	static const Actions actions[256] =  {
		//	00
        ACTION( "authPong",	            a_Pong),
		ACTION( "authResponseVersion",	a_ResponseVersion),
		ACTION( "authLogin",		    a_Login),
		ACTION( "authDisconnect",	    a_Disconnect),
		//  04
        ACTION( "authModulesLoad",	    a_ModulesLoad),

	};

	_actions = actions;
}
Esempio n. 7
0
static void
setVerboseFlags(char *str)
{
    for (; *str; str++)
    {
        switch (*str)
        {
        case 'f':
            verboseLevel |= WantFullNames;
            break;
        case 'h':
            verboseLevel |= WantHiddenMaps;
            break;
        case 'l':
            verboseLevel |= WantLongListing;
            break;
        case 'p':
            verboseLevel |= WantPartialMaps;
            break;
        case 'R':
            verboseLevel |= ListRecursive;
            break;
        default:
            if (warningLevel > 4)
            {
                WARN1("Unknown verbose option \"%c\"\n", (unsigned int) *str);
                ACTION("Ignored\n");
            }
            break;
        }
    }
    return;
}
Esempio n. 8
0
int
ReportBadField(const char *type, const char *field, const char *name)
{
    ERROR("Unknown %s field %s in %s\n", type, field, name);
    ACTION("Ignoring assignment to unknown field in %s\n", name);
    return False;
}
Esempio n. 9
0
int
ReportShouldBeArray(const char *type, const char *field, const char *name)
{
    ERROR("Missing subscript for %s %s\n", type, field);
    ACTION("Ignoring illegal assignment in %s\n", name);
    return False;
}
Esempio n. 10
0
int
ReportNotArray(const char *type, const char *field, const char *name)
{
    ERROR("The %s %s field is not an array\n", type, field);
    ACTION("Ignoring illegal assignment in %s\n", name);
    return False;
}
static void
shell_window_init_switcher_style (EShellWindow *shell_window)
{
	GtkAction *action;
	GSettings *settings;
	GtkToolbarStyle style;
	gchar *string;

	settings = e_util_ref_settings ("org.gnome.evolution.shell");

	action = ACTION (SWITCHER_STYLE_ICONS);
	string = g_settings_get_string (settings, "buttons-style");
	g_object_unref (settings);

	if (string != NULL) {
		if (strcmp (string, "icons") == 0)
			style = GTK_TOOLBAR_ICONS;
		else if (strcmp (string, "text") == 0)
			style = GTK_TOOLBAR_TEXT;
		else if (strcmp (string, "both") == 0)
			style = GTK_TOOLBAR_BOTH_HORIZ;
		else
			style = -1;

		gtk_radio_action_set_current_value (
			GTK_RADIO_ACTION (action), style);

		g_free (string);
	}

	g_signal_connect (
		action, "changed",
		G_CALLBACK (shell_window_save_switcher_style_cb),
		shell_window);
}
Esempio n. 12
0
static void
run_action_goto(t_obj *action_obj)
/*
 * Go to the cue specified in the action details
 */
{
	t_action *	action;
	t_obj *		next_cue_obj;		 /* Next cue to be run	      */
	t_am_args *	args;			 /* Message arguments	      */

	action = ACTION(action_obj);

	next_cue_obj = action->tcue_obj;

	if(!next_cue_obj)
	{
		E("No Cue specified for action [%s]", action->name);
		return;
	}

	args = am_pool_get();
	args->cue.cue_obj = next_cue_obj;
	client2agent_tx(QSHEET(qsheet4action(action_obj))->client,
		am_cue_goto, args);

	return;
}						 /* run_action_goto()	      */
Esempio n. 13
0
File: ui.c Progetto: russells/hc2
static QState uiMenu(struct UI *me)
{
	switch (Q_SIG(me)) {
	case Q_ENTRY_SIG:
		ACTION();
		BSP_fast_timer_1(TRUE);
		BSP_fast_timer_2(TRUE);
		return Q_HANDLED();
	case UI_ACTION_SIGNAL:
		SERIALSTR("U");
		me->timeoutcounter = 4;
		lcd_timeouts(me->timeoutcounter);
		QActive_armX((QActive*)(me), 2,
			     3 * BSP_TICKS_PER_SECOND_TIMER2);
		return Q_HANDLED();
	case Q_TIMEOUT2_SIG:
		me->timeoutcounter --;
		lcd_timeouts(me->timeoutcounter);
		if (me->timeoutcounter) {
			QActive_armX((QActive*)(me), 2,
				     3 * BSP_TICKS_PER_SECOND_TIMER2);
			return Q_HANDLED();
		} else {
			return Q_TRAN(uiRun);
		}
	case BUTTON_CANCEL_PRESS_SIGNAL:
		return Q_TRAN(uiRun);
	case Q_EXIT_SIG:
		BSP_fast_timer_1(FALSE);
		BSP_fast_timer_2(FALSE);
		lcd_timeouts(0);
		return Q_HANDLED();
	}
	return Q_SUPER(uiTop);
}
Esempio n. 14
0
int
ReportBadType(const char *type, const char *field,
              const char *name, const char *wanted)
{
    ERROR("The %s %s field must be a %s\n", type, field, wanted);
    ACTION("Ignoring illegal assignment in %s\n", name);
    return False;
}
Esempio n. 15
0
File: ui.c Progetto: russells/hc2
static QState uiMenuAdjusttime(struct UI *me)
{
	switch (Q_SIG(me)) {
	case Q_ENTRY_SIG:
		SERIALSTR("uiMAT\r\n");
		me->adjustment = BSP_get_adjustment();
		if (me->adjustment >= MAX_ADJ) {
			lcd_buttons(LCD_BUTTONS_ENTER_DOWN_CANCEL);
		} else if (me->adjustment <= MIN_ADJ) {
			lcd_buttons(LCD_BUTTONS_ENTER_DOWN_CANCEL);
		} else {
			lcd_buttons(LCD_BUTTONS_ALL);
		}
		display_adjusttime(me);
		return Q_HANDLED();
	case BUTTON_ENTER_PRESS_SIGNAL:
		ACTION();
		SERIALSTR("b1\r\n");
		BSP_save_adjustment(me->adjustment);
		return Q_TRAN(uiMenuMaybeAdjusttime);
	case BUTTON_UP_PRESS_SIGNAL:
		ACTION();
		if (me->adjustment < MAX_ADJ) {
			SERIALSTR("up\r\n");
			me->adjustment ++;
			lcd_buttons(LCD_BUTTONS_ALL);
			display_adjusttime(me);
		} else {
			lcd_buttons(LCD_BUTTONS_ENTER_DOWN_CANCEL);
		}
		return Q_HANDLED();
	case BUTTON_DOWN_PRESS_SIGNAL:
		ACTION();
		if (me->adjustment > MIN_ADJ) {
			SERIALSTR("down\r\n");
			me->adjustment --;
			lcd_buttons(LCD_BUTTONS_ALL);
			display_adjusttime(me);
		} else {
			lcd_buttons(LCD_BUTTONS_ENTER_UP_CANCEL);
		}
		return Q_HANDLED();
	}
	return Q_SUPER(uiMenu);
}
Esempio n. 16
0
static gboolean
mail_shell_view_key_press_event_cb (EMailShellView *mail_shell_view,
                                    GdkEventKey *event)
{
	EShellView *shell_view;
	EShellWindow *shell_window;
	EShellContent *shell_content;
	EMailView *mail_view;
	EMailReader *reader;
	EMailDisplay *mail_display;
	GtkAction *action;

	shell_view = E_SHELL_VIEW (mail_shell_view);
	shell_window = e_shell_view_get_shell_window (shell_view);

	if ((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK)) != 0)
		return FALSE;

	shell_content = e_shell_view_get_shell_content (shell_view);
	mail_view = e_mail_shell_content_get_mail_view (E_MAIL_SHELL_CONTENT (shell_content));
	reader = E_MAIL_READER (mail_view);
	mail_display = e_mail_reader_get_mail_display (reader);

	switch (event->keyval) {
		case GDK_KEY_space:
			action = ACTION (MAIL_SMART_FORWARD);
			break;

		case GDK_KEY_BackSpace:
			action = ACTION (MAIL_SMART_BACKWARD);
			break;

		default:
			return FALSE;
	}

	if (e_web_view_get_need_input (E_WEB_VIEW (mail_display)) &&
	    gtk_widget_has_focus (GTK_WIDGET (mail_display)))
		return FALSE;

	gtk_action_activate (action);

	return TRUE;
}
Esempio n. 17
0
void LALRTable::printTable() {
    auto& fout = DebugMsg::parser_dbg();
    fout << "=========== LALR TABLE ==========" << endl;
    for (int s = 0; s < VSum; ++s) {
        fout << "\t" << s;
    }
    fout << endl;
    for (int s = 0; s < stateSum; ++s) {
        fout << "I" << s << ":";
        for (int i = 0; i < VSum; ++i) {
            fout << "\t";
            if (ACTION(s,i)=='a') {fout << "acc"; continue;  }
            if (ACTION(s,i))
                fout << ACTION(s,i);
            fout << GOTO(s,i);
        }
        fout << endl;
    }
}
Esempio n. 18
0
File: ui.c Progetto: russells/hc2
static QState uiMenuMaybeCalibrate(struct UI *me)
{
	switch (Q_SIG(me)) {
	case Q_ENTRY_SIG:
		lcd_buttons(LCD_BUTTONS_ALL);
		lcd_showstring("CALTEMP");
		return Q_HANDLED();
	case BUTTON_ENTER_PRESS_SIGNAL:
		ACTION();
		return Q_TRAN(uiMenuCalibrateTemperatureStart);
	case BUTTON_UP_PRESS_SIGNAL:
		ACTION();
		return Q_TRAN(uiMenuMaybeSettime);
	case BUTTON_DOWN_PRESS_SIGNAL:
		ACTION();
		return Q_TRAN(uiMenuMaybeAdjusttime);
	}
	return Q_SUPER(uiMenu);
}
Esempio n. 19
0
static void handle_vanish(struct sched_state *s)
{
	if (ACTION(s, vanishing) && !HANDLING_INTERRUPT(s)) {
		lsprintf(DEV, "agent %d vanish -- ", s->cur_agent->tid);
		print_qs(DEV, s);
		printf(DEV, "\n");
		agent_vanish(s);
		/* the vanishing flag stays on (TODO: is it needed?) */
	}
}
Esempio n. 20
0
static bool handle_fork(struct sched_state *s, int target_tid, bool add_to_rq)
{
	if (ACTION(s, forking) && !HANDLING_INTERRUPT(s) &&
	    s->cur_agent->tid != target_tid) {
		lsprintf(DEV, "agent %d forked (%s) -- ", target_tid,
			 add_to_rq ? "rq" : "dq");
		print_qs(DEV, s);
		printf(DEV, "\n");
		/* Start all newly-forked threads not in the context switcher.
		 * The free pass gets them out of the first assertion on the
		 * cs state flag. Of note, this means we can't reliably use the
		 * cs state flag for anything other than assertions. */
		agent_fork(s, target_tid, add_to_rq);
		/* don't need this flag anymore; fork only forks once */
		ACTION(s, forking) = false;
		return true;
	} else {
		return false;
	}
}
Esempio n. 21
0
File: ui.c Progetto: russells/hc2
static QState uiMenuMaybeSettime(struct UI *me)
{
	switch (Q_SIG(me)) {
	case Q_ENTRY_SIG:
		lcd_buttons(LCD_BUTTONS_ENTER_DOWN_CANCEL);
		lcd_showstring("SETTIME");
		return Q_HANDLED();
	case BUTTON_ENTER_PRESS_SIGNAL:
		ACTION();
		me->settime = *gettimep();
		return Q_TRAN(uiMenuSettimeYears);
	case BUTTON_UP_PRESS_SIGNAL:
		ACTION();
		return Q_HANDLED();
	case BUTTON_DOWN_PRESS_SIGNAL:
		ACTION();
		return Q_TRAN(uiMenuMaybeCalibrate);
	}
	return Q_SUPER(uiMenu);
}
static void
action_save_cb (GtkAction *action,
                EMsgComposer *composer)
{
	EHTMLEditor *editor;
	EHTMLEditorView *view;
	const gchar *filename;
	gint fd;
	GError *error = NULL;

	editor = e_msg_composer_get_editor (composer);
	filename = e_html_editor_get_filename (editor);
	if (filename == NULL) {
		gtk_action_activate (ACTION (SAVE_AS));
		return;
	}

	/* Check if the file already exists and we can create it. */
	fd = g_open (filename, O_RDONLY | O_CREAT | O_EXCL, 0777);
	if (fd < 0) {
		gint errno_saved = errno;

		if (g_file_test (filename, G_FILE_TEST_IS_REGULAR)) {
			gint response;

			response = e_alert_run_dialog_for_args (
				GTK_WINDOW (composer),
				E_ALERT_ASK_FILE_EXISTS_OVERWRITE,
				filename, NULL);
			if (response != GTK_RESPONSE_OK)
				return;
		} else {
			e_alert_submit (
				E_ALERT_SINK (composer),
				E_ALERT_NO_SAVE_FILE, filename,
				g_strerror (errno_saved), NULL);
			return;
		}
	} else
		close (fd);

	if (!e_html_editor_save (editor, filename, TRUE, &error)) {
		e_alert_submit (
			E_ALERT_SINK (composer),
			E_ALERT_NO_SAVE_FILE,
			filename, error->message, NULL);
		g_error_free (error);
		return;
	}

	view = e_html_editor_get_view (editor);
	e_html_editor_view_set_changed (view, TRUE);
}
Esempio n. 23
0
std::ostream &OCamlTabCodeGen::TO_STATE_ACTION_SWITCH()
{
	/* Walk the list of functions, printing the cases. */
	for ( GenActionList::Iter act = actionList; act.lte(); act++ ) {
		/* Write out referenced actions. */
		if ( act->numToStateRefs > 0 ) {
			/* Write the case label, the action and the case break. */
			out << "\t| " << act->actionId << " ->\n";
      ACTION( out, act, 0, false );
		}
	}

	genLineDirective( out );
	return out;
}
Esempio n. 24
0
File: ui.c Progetto: russells/hc2
static QState uiMenuMaybeAdjusttime(struct UI *me)
{
	switch (Q_SIG(me)) {
	case Q_ENTRY_SIG:
		lcd_buttons(LCD_BUTTONS_ENTER_UP_CANCEL);
		lcd_showstring("ADJTIME");
		me->assertionMenuCounter = 0;
		return Q_HANDLED();
	case BUTTON_ENTER_PRESS_SIGNAL:
		ACTION();
		return Q_TRAN(uiMenuAdjusttime);
	case BUTTON_UP_PRESS_SIGNAL:
		ACTION();
		return Q_TRAN(uiMenuMaybeCalibrate);
	case BUTTON_DOWN_PRESS_SIGNAL:
		ACTION();
		me->assertionMenuCounter ++;
		if (me->assertionMenuCounter >= 7) {
			return Q_TRAN(uiMenuShowAssertion);
		}
		return Q_HANDLED();
	}
	return Q_SUPER(uiMenu);
}
Esempio n. 25
0
void ToolBarEditor::populateActionList(bool reset)
{
    QStringList names = ActionManager::instance()->toolBarActionNames();
    if(!reset)
    {
        QSettings settings (Qmmp::configFile(), QSettings::IniFormat);
        names = settings.value("Simple/toolbar_actions", names).toStringList();
    }

    for(int id = ActionManager::PLAY; id <= ActionManager::QUIT; ++id)
    {
        QAction *action = ACTION(id);
        if(action->icon().isNull())
            continue;
        QListWidgetItem *item = new QListWidgetItem();
        item->setIcon(action->icon());
        item->setText(action->text().replace("&", ""));
        item->setData(Qt::UserRole, action->objectName());
        if(!names.contains(action->objectName()))
            m_ui->actionsListWidget->addItem(item);
    }

    {
        QListWidgetItem *item = new QListWidgetItem();
        item->setText("-- " + tr("Separator") + " --");
        item->setData(Qt::UserRole, "separator");
        m_ui->actionsListWidget->addItem(item);
    }

    foreach (QString name, names)
    {
        QAction *action = ActionManager::instance()->findChild<QAction *>(name);
        if(action)
        {
            QListWidgetItem *item = new QListWidgetItem();
            item->setIcon(action->icon());
            item->setText(action->text().replace("&", ""));
            item->setData(Qt::UserRole, action->objectName());
            m_ui->activeActionsListWidget->addItem(item);
        }
        else if(name == "separator")
        {
            QListWidgetItem *item = new QListWidgetItem();
            item->setText("-- " + tr("Separator") + " --");
            item->setData(Qt::UserRole, "separator");
            m_ui->activeActionsListWidget->addItem(item);
        }
    }
Esempio n. 26
0
void GUI::ParseDefinitionElem(struct GUI_DEFINITION_ELEM* guielem)
{
	char output[256];
	sprintf(output, "DEBUG: Beginning parsing gui definition element: %s", guielem->name);
	LogToFile(DEFAULT_GUI_LOG_NAME, output);
	static int exist = 0;
	GUIcontrol* chk = ItemByName(guielem->name);

	if(chk)
	{
		exist++;

		sprintf(guielem->name, "%s%u", guielem->name, exist);
	}

	GUIcontrol* new_ctrl = NULL;

	new_ctrl = new GUIcontrol(guielem->name);

		new_ctrl->SetPos(guielem->x, guielem->y);
		new_ctrl->SetPatternCount(guielem->pattern_count);
		new_ctrl->SetPatternWidth(guielem->pattern_width);
		new_ctrl->SetPatternHeight(guielem->pattern_height);
		new_ctrl->SetCurrentPattern(guielem->pattern_current);
		new_ctrl->SetVisible(guielem->visible);
		new_ctrl->SetTexture(TextureByName(textures, guielem->texture_name));
		new_ctrl->SetColor(guielem->color_red, guielem->color_green, guielem->color_blue, guielem->color_alpha);
		new_ctrl->SetCaption(guielem->caption);
		new_ctrl->SetCaptionFont(FontByName(fonts, guielem->caption_font_name));
		new_ctrl->SetCaptionColor(guielem->caption_color_red, guielem->caption_color_green,
			guielem->caption_color_blue, guielem->caption_color_alpha);
		new_ctrl->SetCaptionPos(guielem->caption_x, guielem->caption_y);
		new_ctrl->SetText(guielem->text);
		new_ctrl->SetTextFont(FontByName(fonts, guielem->text_font_name));
		new_ctrl->SetTextColor(guielem->text_color_red, guielem->text_color_green,
			guielem->text_color_blue, guielem->text_color_alpha);
		new_ctrl->SetTextPos(guielem->text_x, guielem->text_y);
		new_ctrl->SetAction(ACTION(guielem->action));
		new_ctrl->SetNextName(guielem->next);
		new_ctrl->SetParentName(guielem->parent);
		new_ctrl->SetData(guielem->data);
		new_ctrl->SetGroup(GROUP(guielem->group));
	AddControl(new_ctrl);

	sprintf(output, "DEBUG: Finished parsing gui definition element: %s", guielem->name);
	LogToFile(DEFAULT_GUI_LOG_NAME, output);

};
Esempio n. 27
0
std::wostream &CSharpGotoCodeGen::EOF_ACTION_SWITCH()
{
	/* Walk the list of functions, printing the cases. */
	for ( GenActionList::Iter act = actionList; act.lte(); act++ ) {
		/* Write out referenced actions. */
		if ( act->numEofRefs > 0 ) {
			/* Write the case label, the action and the case break. */
			out << L"\tcase " << act->actionId << L":\n";
			ACTION( out, act, 0, true );
			out << L"\tbreak;\n";
		}
	}

	genLineDirective( out );
	return out;
}
Esempio n. 28
0
std::ostream &TabCodeGen::ACTION_SWITCH()
{
	/* Walk the list of functions, printing the cases. */
	for ( GenActionList::Iter act = actionList; act.lte(); act++ ) {
		/* Write out referenced actions. */
		if ( act->numTransRefs > 0 ) {
			/* Write the case label, the action and the case break. */
			out << "\tcase " << act->actionId << ":\n";
			ACTION( out, act, 0, false, false );
			out << "\tbreak;\n";
		}
	}

	genLineDirective( out );
	return out;
}
Esempio n. 29
0
std::wostream &FGotoCodeGen::EXEC_ACTIONS()
{
	/* Loop the actions. */
	for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) {
		if ( redAct->numTransRefs > 0 ) {
			/* 	We are at the start of a glob, write the case. */
			out << L"f" << redAct->actListId << L":\n";

			/* Write each action in the list of action items. */
			for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ )
				ACTION( out, item->value, 0, false, false );

			out << L"\tgoto _again;\n";
		}
	}
	return out;
}
Esempio n. 30
0
std::wostream &FGotoCodeGen::EOF_ACTION_SWITCH()
{
	/* Loop the actions. */
	for ( GenActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) {
		if ( redAct->numEofRefs > 0 ) {
			/* Write the entry label. */
			out << L"\tcase " << redAct->actListId+1 << L":\n";

			/* Write each action in the list of action items. */
			for ( GenActionTable::Iter item = redAct->key; item.lte(); item++ )
				ACTION( out, item->value, 0, true, false );

			out << L"\tbreak;\n";
		}
	}

	genLineDirective( out );
	return out;
}