JBoolean
THXVarTable::OKToRemoveSelectedConstant()
	const
{
	JPoint cell;
	return JI2B( GetEditedCell(&cell) &&
				 itsVarList->OKToRemoveFunction(cell.y + THXVarList::kUserFnOffset) );
}
inline JBoolean
cbIsQualified
	(
	const JString& s
	)
{
	return JI2B(s.Contains(":") || s.Contains("."));
}
JBoolean
JXSaveFileInput::SIsCharacterInWord
	(
	const JString&	text,
	const JIndex	charIndex
	)
{
	return JI2B( text.GetCharacter(charIndex) != '.' );
}
JBoolean
JFileExecutable
	(
	const JCharacter* fileName
	)
{
	if (getuid() == 0)
		{
		ACE_stat stbuf;
		return JI2B( ACE_OS::stat(fileName, &stbuf) == 0 &&
					 (stbuf.st_mode & S_IXUSR) != 0 );
		}
	else
		{
		return JI2B(JFileExists(fileName) &&
					access(fileName, X_OK) == 0);
		}
}
JBoolean
JFileWritable
	(
	const JCharacter* fileName
	)
{
	return JI2B(JFileExists(fileName) &&
				(getuid() == 0 || access(fileName, W_OK) == 0));
}
JBoolean
JFSBindingList::NeedsRevert()
	const
{
	time_t t;
	return JI2B(!itsSignalFileName.IsEmpty() &&
				(JGetModificationTime(itsSignalFileName, &t)).OK() &&
				itsSignalModTime != t);
}
JBoolean
JXFSBindingTable::IsEditable
	(
	const JPoint& cell
	)
	const
{
	return JI2B(cell.x == kPatternColumn || cell.x == kCommandColumn);
}
JBoolean
JIsRelativePath
	(
	const JCharacter* path
	)
{
	assert( !JStringEmpty(path) );
	return JI2B( path[0] != '/' && path[0] != '~' );
}
JBoolean
CBCommandTable::IsEditable
	(
	const JPoint& cell
	)
	const
{
	return JI2B( cell.x != kOptionsColumn );
}
JBoolean
CBGetMDIServer
	(
	CBMDIServer** mdi
	)
{
	*mdi = theMDIServer;
	return JI2B( theMDIServer != NULL );
}
Example #11
0
JBoolean
JNameUsed
	(
	const JCharacter* name
	)
{
	ACE_stat info;
	return JI2B( ACE_OS::lstat(name, &info) == 0 );
}
Example #12
0
JBoolean
JIsRootDirectory
	(
	const JCharacter* dirName
	)
{
	assert( !JStringEmpty(dirName) );
	return JI2B( dirName[0] == '/' && dirName[1] == '\0' );
}
JBoolean
JXDockDirector::GetFocusWindow
	(
	JXWindow** window
	)
{
	*window = itsFocusWindow;
	return JI2B( itsFocusWindow != NULL );
}
Example #14
0
JBoolean
JDirectoryWritable
	(
	const JCharacter* dirName
	)
{
	return JI2B(JDirectoryExists(dirName) &&
				(getuid() == 0 || access(dirName, W_OK) == 0));
}
JBoolean
JXPathInput::IsCharacterInWord
	(
	const JString&	text,
	const JIndex	charIndex
	)
{
	return JI2B( text.GetCharacter(charIndex) != ACE_DIRECTORY_SEPARATOR_CHAR );
}
Example #16
0
void
CMLink::SetBreakpoint
	(
	const CMBreakpoint& bp
	)
{
	SetBreakpoint(bp.GetFileName(), bp.GetLineNumber(),
				  JI2B(bp.GetAction() == CMBreakpoint::kRemoveBreakpoint));
}
Example #17
0
JBoolean
JCanEnterDirectory
	(
	const JCharacter* dirName
	)
{
	return JI2B(JDirectoryExists(dirName) &&
				(getuid() == 0 || access(dirName, X_OK) == 0));
}
JBoolean
JXTreeListWidget::IsEditable
	(
	const JPoint& cell
	)
	const
{
	return JI2B( JIndex(cell.x) != itsToggleOpenColIndex );
}
JBoolean
JXFloatInput::GetValue
	(
	JFloat* value
	)
	const
{
	return JI2B((GetText()).ConvertToFloat(value) && ValueValid(*value));
}
JBoolean
JDirInfo::IsVisible
	(
	const JDirEntry& entry
	)
	const
{
	const JDirEntry::Type type = entry.GetType();
	const JString& name        = entry.GetName();

	if (name.GetFirstCharacter() == '.' && name != ".." && !itsShowHiddenFlag)
		{
		return kJFalse;
		}

	if (type == JDirEntry::kDir || type == JDirEntry::kDirLink)
		{
		return JI2B(itsShowDirsFlag &&
					(!itsFilterDirsFlag || MatchesNameFilter(entry)) &&
					MatchesDirEntryFilter(entry));
		}
	else if (type == JDirEntry::kFile || type == JDirEntry::kFileLink ||
			 type == JDirEntry::kBrokenLink)
		{
		return JI2B(itsShowFilesFlag &&
					MatchesNameFilter(entry) &&
					MatchesDirEntryFilter(entry));
		}
	else if (type == JDirEntry::kUnknown || type == JDirEntry::kUnknownLink)
		{
		return JI2B(itsShowOthersFlag &&
					MatchesNameFilter(entry) &&
					MatchesDirEntryFilter(entry));
		}
	else if (type == JDirEntry::kDoesNotExist)
		{
		return kJFalse;
		}
	else
		{
		assert( 0 );	// this should never happen
		return kJFalse;
		}
}
Example #21
0
CBFileListDirector::CBFileListDirector
	(
	istream&			projInput,
	const JFileVersion	projVers,
	istream*			setInput,
	const JFileVersion	setVers,
	istream*			symInput,
	const JFileVersion	symVers,
	CBProjectDocument*	supervisor,
	const JBoolean		subProject
	)
	:
	JXWindowDirector(supervisor)
{
	CBFileListDirectorX(supervisor);

	if (projVers >= 20)
		{
		const JBoolean useProjData = JI2B( setInput == NULL || setVers < 71 );
		if (projVers < 71)
			{
			if (useProjData)
				{
				(GetWindow())->ReadGeometry(projInput);
				}
			else
				{
				JXWindow::SkipGeometry(projInput);
				}

			JBoolean active = kJFalse;
			if (projVers >= 50)
				{
				projInput >> active;
				}
			if (useProjData && active && !subProject)
				{
				Activate();
				}

			itsFLSet->ReadSetup(projInput);		// no way to skip
			}

		if (!useProjData)
			{
			(GetWindow())->ReadGeometry(*setInput);

			JBoolean active;
			*setInput >> active;
			if (active && !subProject)
				{
				Activate();
				}

			itsFLSet->ReadSetup(*setInput);
			}
void
JXMacWinPrefsDialog::BuildWindow()
{
// begin JXLayout

    JXWindow* window = new JXWindow(this, 350,200, "");
    assert( window != NULL );
    SetWindow(window);

    JXTextButton* okButton =
        new JXTextButton(JGetString("okButton::JXMacWinPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedRight, JXWidget::kFixedTop, 209,169, 62,22);
    assert( okButton != NULL );
    okButton->SetShortcuts(JGetString("okButton::JXMacWinPrefsDialog::shortcuts::JXLayout"));

    JXTextButton* cancelButton =
        new JXTextButton(JGetString("cancelButton::JXMacWinPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 80,170, 60,20);
    assert( cancelButton != NULL );

    itsMacStyleCB =
        new JXTextCheckbox(JGetString("itsMacStyleCB::JXMacWinPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 320,20);
    assert( itsMacStyleCB != NULL );

    itsHomeEndCB =
        new JXTextCheckbox(JGetString("itsHomeEndCB::JXMacWinPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,70, 320,20);
    assert( itsHomeEndCB != NULL );

    JXStaticText* obj1_JXLayout =
        new JXStaticText(JGetString("obj1_JXLayout::JXMacWinPrefsDialog::JXLayout"), window,
                    JXWidget::kHElastic, JXWidget::kVElastic, 40,40, 300,20);
    assert( obj1_JXLayout != NULL );
    obj1_JXLayout->SetFontSize(10);

    itsScrollCaretCB =
        new JXTextCheckbox(JGetString("itsScrollCaretCB::JXMacWinPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,100, 320,20);
    assert( itsScrollCaretCB != NULL );

    itsCopyWhenSelectCB =
        new JXTextCheckbox(JGetString("itsCopyWhenSelectCB::JXMacWinPrefsDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,130, 320,20);
    assert( itsCopyWhenSelectCB != NULL );

// end JXLayout

	window->SetTitle("Macintosh / Windows / X Preferences");
	SetButtons(okButton, cancelButton);

	itsMacStyleCB->SetState(JI2B(JXMenu::GetDisplayStyle() == JXMenu::kMacintoshStyle));
	itsHomeEndCB->SetState(JXTEBase::WillUseWindowsHomeEnd());
	itsScrollCaretCB->SetState(JXTEBase::CaretWillFollowScroll());
	itsCopyWhenSelectCB->SetState(JTextEditor::WillCopyWhenSelect());
}
JBoolean
CBMacroSetTable::ContentsValid()
	const
{
	CBMacroSetTable* me = const_cast<CBMacroSetTable*>(this);

	return JI2B(me->EndEditing() &&
				itsActionTable->ContentsValid() &&
				itsMacroTable->ContentsValid());
}
JBoolean
JXTreeListWidget::IsSelectable
	(
	const JPoint&	cell,
	const JBoolean	forExtend
	)
	const
{
	return JI2B( JIndex(cell.x) == itsNodeColIndex );
}
Example #25
0
JBoolean
JRTTIBase::Is
	(
	const JCharacter* type
	)
	const
{
	assert( type != NULL );	// make sure static constant was initialized
	return JI2B( type == itsType || strcmp(type, itsType) == 0 );
}
Example #26
0
JBoolean
JXTable::HandleSelectionKeyPress
	(
	const int				key,
	const JXKeyModifiers&	modifiers
	)
{
	return JI2B(0 < key && key <= 255 &&
				JTable::HandleSelectionKeyPress(key, modifiers.shift()));
}
JBoolean
CBCtagsUser::IsParsed
	(
	const CBTextFileType type
	)
{
	assert( kFTCount == kCBFTCount && kFTInfo[type].fileType == type );

	return JI2B( kFTInfo[type].lang != kCBOtherLang );
}
JBoolean
CBCtagsUser::IsParsedForFunctionMenu
	(
	const CBTextFileType type
	)
{
	assert( kFTCount == kCBFTCount && kFTInfo[type].fileType == type );

	return JI2B( kFTInfo[type].fnTitle != kDefFnTitle );
}
Example #29
0
JBoolean
JXWidget::GetDragPainter
	(
	JPainter** p
	)
	const
{
	*p = itsDragPainter;
	return JI2B(itsDragPainter != NULL);
}
Example #30
0
JBoolean
SyGIsTrashDirectory
	(
	const JCharacter* path
	)
{
	JString dir;
	return JI2B(SyGGetTrashDirectory(&dir, kJFalse) &&
				JSameDirEntry(dir, path));
}