本文整理汇总了C++中ACTION函数的典型用法代码示例。如果您正苦于以下问题:C++ ACTION函数的具体用法?C++ ACTION怎么用?C++ ACTION使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ACTION函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: uiMenuSettimeHours
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);
}
开发者ID:russells,项目名称:hc2,代码行数:33,代码来源:ui.c
示例2: uiMenuCalibrate
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);
}
开发者ID:russells,项目名称:hc2,代码行数:58,代码来源:ui.c
示例3: e_cal_shell_view_memopad_actions_update
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);
}
开发者ID:Distrotech,项目名称:evolution,代码行数:57,代码来源:e-cal-shell-view-memopad.c
示例4: handle_sleep
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;
}
}
开发者ID:jinlee,项目名称:masters,代码行数:13,代码来源:schedule.c
示例5: ACTION
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;
}
开发者ID:segrax,项目名称:KiLLARMY,代码行数:14,代码来源:moduleAdmin.cpp
示例6: ACTION
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;
}
开发者ID:segrax,项目名称:KiLLARMY,代码行数:15,代码来源:moduleAuth.cpp
示例7: setVerboseFlags
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;
}
开发者ID:geekmaster,项目名称:buildroot-kindle,代码行数:33,代码来源:xkbcomp.c
示例8: ReportBadField
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;
}
开发者ID:diegonc,项目名称:libxkbcommon,代码行数:7,代码来源:misc.c
示例9: ReportShouldBeArray
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;
}
开发者ID:diegonc,项目名称:libxkbcommon,代码行数:7,代码来源:misc.c
示例10: ReportNotArray
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;
}
开发者ID:diegonc,项目名称:libxkbcommon,代码行数:7,代码来源:misc.c
示例11: shell_window_init_switcher_style
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);
}
开发者ID:Distrotech,项目名称:evolution,代码行数:35,代码来源:e-shell-window-private.c
示例12: run_action_goto
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() */
开发者ID:Prichy,项目名称:SoundDesk,代码行数:27,代码来源:run_actions.c
示例13: uiMenu
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);
}
开发者ID:russells,项目名称:hc2,代码行数:35,代码来源:ui.c
示例14: ReportBadType
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;
}
开发者ID:diegonc,项目名称:libxkbcommon,代码行数:8,代码来源:misc.c
示例15: uiMenuAdjusttime
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);
}
开发者ID:russells,项目名称:hc2,代码行数:45,代码来源:ui.c
示例16: ACTION
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;
}
}
开发者ID:elite-lang,项目名称:LR_Scanner,代码行数:19,代码来源:LALRTable.cpp
示例17: uiMenuMaybeCalibrate
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);
}
开发者ID:russells,项目名称:hc2,代码行数:19,代码来源:ui.c
示例18: handle_vanish
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?) */
}
}
开发者ID:jinlee,项目名称:masters,代码行数:10,代码来源:schedule.c
示例19: handle_fork
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;
}
}
开发者ID:jinlee,项目名称:masters,代码行数:20,代码来源:schedule.c
示例20: uiMenuMaybeSettime
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);
}
开发者ID:russells,项目名称:hc2,代码行数:20,代码来源:ui.c
注:本文中的ACTION函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论