예제 #1
0
bool EmitterState::SetIndent(std::size_t value, FmtScope::value scope) {
  if (value <= 1)
    return false;

  _Set(m_indent, value, scope);
  return true;
}
예제 #2
0
 bool EmitterState::SetDoublePrecision(int value, FMT_SCOPE scope)
 {
     if(value < 0 || value > std::numeric_limits<double>::digits10)
         return false;
     _Set(m_doublePrecision, value, scope);
     return true;
 }
예제 #3
0
bool EmitterState::SetPostCommentIndent(std::size_t value,
                                        FmtScope::value scope) {
  if (value == 0)
    return false;

  _Set(m_postCommentIndent, value, scope);
  return true;
}
예제 #4
0
	bool EmitterState::SetPostCommentIndent(unsigned value, FMT_SCOPE scope)
	{
		if(value == 0)
			return false;
		
		_Set(m_postCommentIndent, value, scope);
		return true;
	}
예제 #5
0
bool EmitterState::SetMapKeyFormat(EMITTER_MANIP value, FmtScope::value scope) {
  switch (value) {
    case Auto:
    case LongKey:
      _Set(m_mapKeyFmt, value, scope);
      return true;
    default:
      return false;
  }
}
예제 #6
0
bool EmitterState::SetFlowType(GroupType::value groupType, EMITTER_MANIP value,
                               FmtScope::value scope) {
  switch (value) {
    case Block:
    case Flow:
      _Set(groupType == GroupType::Seq ? m_seqFmt : m_mapFmt, value, scope);
      return true;
    default:
      return false;
  }
}
예제 #7
0
bool EmitterState::SetBoolLengthFormat(EMITTER_MANIP value,
                                       FmtScope::value scope) {
  switch (value) {
    case LongBool:
    case ShortBool:
      _Set(m_boolLengthFmt, value, scope);
      return true;
    default:
      return false;
  }
}
예제 #8
0
bool EmitterState::SetIntFormat(EMITTER_MANIP value, FmtScope::value scope) {
  switch (value) {
    case Dec:
    case Hex:
    case Oct:
      _Set(m_intFmt, value, scope);
      return true;
    default:
      return false;
  }
}
예제 #9
0
bool EmitterState::SetBoolFormat(EMITTER_MANIP value, FmtScope::value scope) {
  switch (value) {
    case OnOffBool:
    case TrueFalseBool:
    case YesNoBool:
      _Set(m_boolFmt, value, scope);
      return true;
    default:
      return false;
  }
}
예제 #10
0
bool EmitterState::SetOutputCharset(EMITTER_MANIP value,
                                    FmtScope::value scope) {
  switch (value) {
    case EmitNonAscii:
    case EscapeNonAscii:
      _Set(m_charset, value, scope);
      return true;
    default:
      return false;
  }
}
예제 #11
0
	bool EmitterState::SetFlowType(GROUP_TYPE groupType, EMITTER_MANIP value, FMT_SCOPE scope)
	{
		switch(value) {
			case Block:
			case Flow:
				_Set(groupType == GT_SEQ ? m_seqFmt : m_mapFmt, value, scope);
				return true;
			default:
				return false;
		}
	}
예제 #12
0
bool WndSetCache( a_window *wnd, bool on )
{
    bool        old;

    old = _Is( wnd, WSW_CACHE_LINES );
    if( on ) {
        _Set( wnd, WSW_CACHE_LINES );
    } else {
        _Clr( wnd, WSW_CACHE_LINES );
    }
    return( old );
}
예제 #13
0
bool EmitterState::SetBoolCaseFormat(EMITTER_MANIP value,
                                     FmtScope::value scope) {
  switch (value) {
    case UpperCase:
    case LowerCase:
    case CamelCase:
      _Set(m_boolCaseFmt, value, scope);
      return true;
    default:
      return false;
  }
}
예제 #14
0
bool EmitterState::SetStringFormat(EMITTER_MANIP value, FmtScope::value scope) {
  switch (value) {
    case Auto:
    case SingleQuoted:
    case DoubleQuoted:
    case Literal:
      _Set(m_strFmt, value, scope);
      return true;
    default:
      return false;
  }
}
예제 #15
0
void GlobalSettings::AddRecentFilePath(QString const &path)
{
    int lastIndex = m_recentPaths.indexOf(path);
    if (-1 != lastIndex)
        m_recentPaths.move(lastIndex, 0);
    else
    {
        if (GetRecetFilePathCount() >= MAX_RECENT_FILE_COUNT)
            m_recentPaths.pop_back();

        m_recentPaths.push_front(path);
    }
    _Set(Key_RecentFilePaths, m_recentPaths.join(RECENT_FILE_SEPARATOR));
}
예제 #16
0
extern  bool    WndGetLine( a_window *wnd, int row, int piece,
                            wnd_line_piece *line )
{
    int         virtual_row;
    bool        success;

    virtual_row = WndVirtualRow( wnd, row );
    if( _Is( wnd, WSW_CACHE_LINES ) ) {
        if( FindCacheLine( wnd, virtual_row, piece, line ) ) return( TRUE );
    }
    line->attr = WndPlainAttr;
    line->indent = 0;
    line->static_text = FALSE;
    line->tabstop = TRUE;
    line->hot = FALSE;
    line->extent = WND_NO_EXTEND;
    line->master_tabstop = FALSE;
    line->underline = FALSE;
    line->draw_bar = FALSE;
    line->vertical_line = FALSE;
    line->draw_hook = FALSE;
    line->draw_line_hook = FALSE;
    line->bitmap = FALSE;
    line->use_piece0_attr = FALSE;
    line->use_prev_attr = FALSE;
    line->use_key = TRUE;
    line->text = "";
    line->hint = "";
    if( virtual_row < -wnd->title_size ) return( FALSE );
    if( row == wnd->u.button_down.row && piece == wnd->u.button_down.piece ) {
        _Set( wnd, WSW_ALTERNATE_BIT );
    }
    success = wnd->info->getline( wnd, virtual_row, piece, line );
    _Clr( wnd, WSW_ALTERNATE_BIT );
    if( success ) {
        if( !(line->bitmap|line->vertical_line|line->draw_hook|line->draw_line_hook|line->draw_bar) ) {
            line->length = strlen( line->text );
        }
        if( virtual_row > wnd->max_row ) wnd->max_row = virtual_row;
    }
    if( success ) {
        if( _Is( wnd, WSW_CACHE_LINES ) ) {
            SetCacheLine( wnd, virtual_row, piece, line );
        }
    }
    return( success );
}
예제 #17
0
//0 success
ssize_t MemKeyCache::Set(const char* pKey,const ssize_t KEYSIZE,
			char* szData,ssize_t iDataSize,ssize_t iDataFlag/*=F_DATA_DIRTY*/,
			char* pReserve/*=NULL*/,ssize_t iReserveLen/*=0*/)
{
	ssize_t iOldDataFlag = 0;
	ssize_t iRet = _Set(pKey,KEYSIZE,szData,iDataSize,iDataFlag,iOldDataFlag,pReserve,iReserveLen);
	if(iRet != 0)
	{
		return iRet;
	}

	//写binlog
	if (m_iBinLogOpen)
	{
		if((iDataFlag != F_DATA_CLEAN) || (iOldDataFlag != F_DATA_CLEAN))
		{
			iRet = _WriteDataLog(op_set,pKey,KEYSIZE,szData,iDataSize,iDataFlag,pReserve,iReserveLen);
			if(iRet != 0)
				return E_WRITE_BINLOG;
		}
	}

	return 0;
}
예제 #18
0
void GlobalSettings::SetLanguage(QString const &language)
{
    _Set(Key_GuiLanguage, language);
}
예제 #19
0
void GlobalSettings::SetLastSerialPortId(QString const &portId)
{
    _Set(Key_LastSerialPortId, portId);
}
예제 #20
0
void GlobalSettings::SetLastSerialPortType(QVariant const &portType)
{
    _Set(Key_LastSerialPortType, portType);
}
예제 #21
0
void GlobalSettings::SetAcceptChangesByDialogClosing(bool show)
{
    _Set(Key_AcceptChangesByDialogClosing, show);
}
예제 #22
0
void GlobalSettings::SetChannelSizeFactor(int multiplier)
{
    _Set(Key_ChannelSizeFactor, multiplier);
}
예제 #23
0
void GlobalSettings::SetMenuIsShown(bool isShown)
{
    _Set(Key_MenuIsShown, isShown);
}
예제 #24
0
void GlobalSettings::SetMenuOnDemand(bool onDemand)
{
    _Set(Key_MenuOnDemand, onDemand);
}
예제 #25
0
void    WndForcePaint( a_window *wnd )
{
    _Set( wnd, WSW_NOT_TO_SCREEN );
    if( wnd->max_indent == 0 ) WndPaintRows( wnd, 0, wnd->rows );
    _Clr( wnd, WSW_NOT_TO_SCREEN );
}
예제 #26
0
	void ConsumeEmptyGlyph(int32 index, uint32 charCode, double x, double y)
	{
		_Set(index, 0, 0);
	}
예제 #27
0
static a_window *WndCreateWithStructBody( wnd_create_struct *info,
                                          gui_create_info *init )
{
    a_window    *wnd;
    gui_window  *gui;
    char        buff[256];
    int         size;

    if( info->title == NULL ) {
        buff[0] = '\0';
    } else {        // might be clobbered by create
        strcpy( buff, info->title );
    }
    if( info->title != NULL )
        strcpy( buff, info->title ); // might be clobbered by create
    size = sizeof( *wnd ) + ( WndMaxDirtyRects - 1 ) * sizeof( wnd->dirty ); //
    wnd = WndAlloc( size );
    if( wnd == NULL ) {
        WndFree( info->extra );
        WndNoMemory();
    }
    memset( wnd, 0, size );
    wnd->u.button_down.row = (char)-1;
    wnd->gui = NULL;
    wnd->info = info->info;
    wnd->wndclass = info->wndclass;
    wnd->extra = info->extra;
    wnd->title_size = info->title_size;
    wnd->rows = 1;      // just so it's not zero in init code
    WndNoSelect( wnd );
    WndNoCurrent( wnd );
    WndSetCurrCol( wnd );
    WndNullPopItem( wnd );
    wnd->dirtyrects= 0; // wndnoselect changes this!
    wnd->vscroll_pending = 0;
    wnd->hscroll_pending = -1;
    wnd->keypiece = WND_NO_PIECE;

    wnd->switches = WSW_SELECT_IN_TABSTOP | WSW_MUST_CLICK_ON_PIECE |
                    WSW_ALLOW_POPUP | WSW_SEARCH_WRAP | WSW_HIGHLIGHT_CURRENT |
                    WSW_ONLY_MODIFY_TABSTOP | WSW_MENU_ACCURATE_ROW;

    if( info->rect.width == 0 || info->rect.height == 0 ) {
        init->rect.x = 0;
        init->rect.y = 0;
        init->rect.width = WndMax.x;
        init->rect.height = WndMax.y;
    } else {
        init->rect.x = info->rect.x;
        init->rect.y = info->rect.y;
        init->rect.width = info->rect.width;
        init->rect.height = info->rect.height;
    }
    init->scroll = info->scroll;
    init->style = info->style;
    init->style |= GUI_VSCROLL_EVENTS;
    init->style &= ~GUI_HSCROLL_EVENTS;
    init->title = ( info->title == NULL ) ? NULL : "";
    if( WndMain != NULL ) {
        init->style |= GUI_VISIBLE;
        init->parent = WndMain->gui;
        init->num_menus = 0;
        init->menu = NULL;
    } else {
        init->style &= ~GUI_VISIBLE;
        init->scroll = GUI_NOSCROLL;
        init->num_menus = WndNumMenus;
        init->menu = WndMainMenu;
        init->parent = NULL;
    }
    if( init->style & GUI_POPUP ) {
        init->parent = NULL;
    }
    init->num_attrs = WndNumColours;
    init->colours = info->colour;
    init->call_back = WndMainEventProc;
    init->extra = wnd;

    _Set( wnd, WSW_ACTIVE );

    gui = GUICreateWindow( init );
    if( gui == NULL ) {
        WndFree( info->extra );
        WndFree( wnd );
        WndNoMemory();
        return( NULL );
    } else {
        if( buff[0] != '\0' ) {
            WndSetTitle( wnd, buff );
        }
    }
    ++NumWindows;
    return( wnd );
}
예제 #28
0
void GlobalSettings::SetHideAllChannels(bool show)
{
     _Set(Key_HideAllChannels, show);
}
예제 #29
0
	bool ConsumeGlyph(int32 index, uint32 charCode, const GlyphCache* glyph,
		FontCacheEntry* entry, double x, double y, double advanceX,
			double advanceY)
	{
		return _Set(index, advanceX, advanceY);
	}
예제 #30
0
void GlobalSettings::SetMenuOrientation(Qt::Orientation orientation)
{
    _Set(Key_MenuOrientation, orientation);
}