本文整理汇总了C++中XttTbl类的典型用法代码示例。如果您正苦于以下问题:C++ XttTbl类的具体用法?C++ XttTbl怎么用?C++ XttTbl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XttTbl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xtttbl_show_func
static int xtttbl_show_func( void *client_data,
void *client_flag)
{
XttTbl *xtttbl = (XttTbl *)client_data;
char arg1_str[80];
int arg1_sts;
arg1_sts = dcli_get_qualifier( "dcli_arg1", arg1_str, sizeof(arg1_str));
if ( strncmp( arg1_str, "USER", strlen( arg1_str)) == 0) {
char msg[120];
char priv_str[80];
if ( strcmp( xtttbl->user, "") == 0) {
user_RtPrivToString( xtttbl->priv, priv_str, sizeof(priv_str));
sprintf( msg, "Not logged in (%s)", priv_str);
xtttbl->message('I', msg);
}
else {
user_RtPrivToString( xtttbl->priv, priv_str, sizeof(priv_str));
sprintf( msg, "User %s (%s)", xtttbl->user, priv_str);
xtttbl->message('I', msg);
}
}
else
xtttbl->message('E',"Syntax error");
return 1;
}
示例2: sevhist_get_select_cb
int XttTbl::sevhist_get_select_cb(
void* ctx, pwr_tOid* oid, char* aname, char* oname)
{
XttTbl* xtttbl = (XttTbl*)ctx;
ItemBase* item;
if (!xtttbl->tblnav->get_select(&item)) {
xtttbl->message('E', "Select an storage item");
return 0;
}
switch (item->type) {
case tblnav_eItemType_Local:
case tblnav_eItemType_TreeLocal: {
TblNav_sevhistobject* hi = &((ItemLocal*)item)->item;
if (hi->attrnum > 1)
return 0;
*oid = hi->oid;
strcpy(aname, hi->objectattrlist[0].aname);
strcpy(oname, hi->oname);
break;
}
default:
return 0;
}
return 1;
}
示例3: activate_print
void XttTblGtk::activate_print(GtkWidget* w, gpointer data)
{
XttTbl* xtt = (XttTbl*)data;
if (!xtt->is_authorized())
return;
xtt->activate_print();
}
示例4: activate_list_layout
void XttTblGtk::activate_list_layout(GtkWidget* w, gpointer data)
{
XttTbl* xtt = (XttTbl*)data;
if (!xtt->is_authorized())
return;
xtt->tblnav->show_list();
}
示例5: activate_delete_item
void XttTblGtk::activate_delete_item(GtkWidget* w, gpointer data)
{
XttTbl* xtt = (XttTbl*)data;
if (!xtt->is_authorized(pwr_mPrv_SevAdmin))
return;
xtt->activate_delete_item();
}
示例6: xtttbl_login_success_bc
static void xtttbl_login_success_bc( void *ctx)
{
XttTbl *xtttbl = (XttTbl *)ctx;
char msg[80];
CoLogin::get_login_info( 0, 0, xtttbl->user, (unsigned long *)&xtttbl->priv, 0);
sprintf( msg, "User %s logged in", xtttbl->user);
xtttbl->cologin = 0;
xtttbl->message('I', msg);
}
示例7: xtttbl_ccm_errormessage_func
static int xtttbl_ccm_errormessage_func( char *msg, int severity, void *client_data)
{
XttTbl *xtttbl = (XttTbl *) client_data;
if ( EVEN(severity))
xtttbl->message( 'I', msg);
else
xtttbl->message( 'E', msg);
return 1;
}
示例8: valchanged_cmd_input
void XttTblGtk::valchanged_cmd_input(GtkWidget* w, gpointer data)
{
XttTbl* xtt = (XttTbl*)data;
int sts;
char *text, *textutf8;
textutf8 = gtk_editable_get_chars(GTK_EDITABLE(w), 0, -1);
text = g_convert(textutf8, -1, "ISO8859-1", "UTF-8", NULL, NULL, NULL);
g_free(textutf8);
sts = xtt->command(text);
g_object_set(w, "visible", FALSE, NULL);
xtt->set_prompt("");
xtt->command_open = 0;
xtt->tblnav->set_inputfocus();
}
示例9: delete_item_yes
void XttTbl::delete_item_yes(void* ctx, void* data)
{
XttTbl* tbl = (XttTbl*)ctx;
// sevcli_sHistItem *hi = (sevcli_sHistItem *)data;
TblNav_sevhistobject* hi = (TblNav_sevhistobject*)data;
pwr_tStatus sts;
printf("Deleting %s\n", hi->oname);
sevcli_delete_item(&sts, tbl->sevcli, hi->oid, hi->objectattrlist[0].aname);
if (EVEN(sts)) {
tbl->message('E', "Delete error");
return;
}
tbl->tblnav->delete_item(hi);
tbl->message('I', "Item deleted");
}
示例10: xtttbl_open_func
static int xtttbl_open_func( void *client_data,
void *client_flag)
{
XttTbl *xtttbl = (XttTbl *)client_data;
char arg1_str[80];
int arg1_sts;
arg1_sts = dcli_get_qualifier( "dcli_arg1", arg1_str, sizeof(arg1_str));
if ( strncmp( arg1_str, "GRAPH", strlen( arg1_str)) == 0)
{
}
else
xtttbl->message('E',"Syntax error");
return XTTTBL__SUCCESS;
}
示例11: xtttbl_logout_func
static int xtttbl_logout_func( void *client_data,
void *client_flag)
{
XttTbl *xtttbl = (XttTbl *)client_data;
char msg[80];
if ( strcmp( xtttbl->base_user, "") == 0)
{
sprintf( msg, "User %s logged out", xtttbl->user);
xtttbl->message('I', msg);
}
else
{
sprintf( msg, "Returned to user %s", xtttbl->base_user);
xtttbl->message('I', msg);
}
strcpy( xtttbl->user, xtttbl->base_user);
xtttbl->priv = xtttbl->base_priv;
return 1;
}
示例12: g_object_set
void XttTblGtk::activate_command(GtkWidget* w, gpointer data)
{
XttTbl* xtt = (XttTbl*)data;
if (!xtt->is_authorized())
return;
if (xtt->command_open) {
g_object_set(((XttTblGtk*)xtt)->cmd_input, "visible", FALSE, NULL);
xtt->set_prompt("");
xtt->command_open = 0;
return;
}
gtk_editable_delete_text(GTK_EDITABLE(((XttTblGtk*)xtt)->cmd_input), 0, -1);
g_object_set(((XttTblGtk*)xtt)->cmd_input, "visible", TRUE, NULL);
xtt->message(' ', "");
gtk_widget_grab_focus(((XttTblGtk*)xtt)->cmd_input);
xtt->set_prompt("xtt >");
xtt->command_open = 1;
}
示例13: xtttbl_login_func
static int xtttbl_login_func( void *client_data,
void *client_flag)
{
XttTbl *xtttbl = (XttTbl *)client_data;
int sts;
char arg1_str[80];
char arg2_str[80];
char systemgroup[80];
unsigned int priv;
char msg[80];
// sts = gdh_GetObjectInfo ( "pwrNode-System.SystemGroup", &systemgroup,
// sizeof(systemgroup));
// if ( EVEN(sts)) return sts;
sts = xtttbl->read_bootfile( 0, systemgroup);
if ( EVEN( dcli_get_qualifier( "dcli_arg1", arg1_str, sizeof(arg1_str))))
{
xtttbl->cologin = xtttbl->login_new( "PwR Login", systemgroup, xtttbl_login_success_bc,
xtttbl_login_cancel_bc, &sts);
return 1;
}
if ( EVEN( dcli_get_qualifier( "dcli_arg2", arg2_str, sizeof(arg2_str))))
{
xtttbl->message('E',"Syntax error");
return 1;
}
cdh_ToLower( arg1_str, arg1_str);
cdh_ToLower( arg2_str, arg2_str);
sts = user_CheckUser( systemgroup, arg1_str, UserList::pwcrypt(arg2_str), &priv);
if ( EVEN(sts))
xtttbl->message('E',"Login failure");
else
{
strcpy( xtttbl->user, arg1_str);
xtttbl->priv = priv;
sprintf( msg, "User %s logged in", arg1_str);
xtttbl->message('I', msg);
}
return sts;
}
示例14: activate_login
void XttTblGtk::activate_login(GtkWidget* w, gpointer data)
{
XttTbl* xtt = (XttTbl*)data;
xtt->open_login();
}
示例15: activate_logout
void XttTblGtk::activate_logout(GtkWidget* w, gpointer data)
{
XttTbl* xtt = (XttTbl*)data;
xtt->logout();
}