本文整理汇总了C++中UAS_Pointer类的典型用法代码示例。如果您正苦于以下问题:C++ UAS_Pointer类的具体用法?C++ UAS_Pointer怎么用?C++ UAS_Pointer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UAS_Pointer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Mark_mmdb::Mark_mmdb (MarkBase_mmdb &base, UAS_Pointer<UAS_Common> &doc_ptr,
const Anchor &anchor,
const char *name, const char *notes)
: f_doc_ptr (doc_ptr),
f_anchor (anchor),
f_mark_base (base),
f_name (NULL),
f_notes (NULL)
{
// This creates a new user mark in the mmdb mark database.
#ifdef FUJITSU_OLIAS
// Id = bookcase id / section id
UAS_String theId = doc_ptr->bid();
theId = theId + "/" + doc_ptr->id();
#else
UAS_String theId = doc_ptr->id();
#endif
f_user_mark = new mark_smart_ptr (base, theId);
set_name (name);
set_notes (notes);
// Flush the new mark to disk.
do_save();
}
示例2: PrintOneUASCommon
static void
PrintOneUASCommon(UAS_Pointer<UAS_Common> &doc, Widget pshell, int *cur_pageP)
{
Arg args[15];
int n;
XmString label;
char buf[BUFSIZ];
// Retrieve the topic from the doc
// The retrieve function will send a UAS_DocumentRetrievedMsg to the
// print manager which will render the canvas with the appropriate topic
doc->retrieve((void *)1);
// set print orientation to either landscape or portrait (if set)
if (f_printOrientation != NULL) {
snprintf(buf, sizeof(buf),
"*content-orientation: %s\n", f_printOrientation);
XpSetAttributes(XtDisplay(pshell), XpGetContext(XtDisplay(pshell)),
XPPageAttr, buf, XPAttrMerge);
}
for (gHelpDisplayArea->firstVisible = gHelpDisplayArea->nextNonVisible = 0;
gHelpDisplayArea->nextNonVisible >= 0;
gHelpDisplayArea->firstVisible = gHelpDisplayArea->nextNonVisible + 1)
{
(*cur_pageP)++;
XpStartPage(XtDisplay(pshell), XtWindow(pshell));
snprintf(buf, sizeof(buf), "%d", *cur_pageP);
label = XmStringCreateLocalized(buf);
n = 0;
XtSetArg(args[n], XmNlabelString, label); n++;
XtSetValues(footer_page_no, args, n);
XmStringFree(label);
// Process exposures so label is updated.
XmUpdateDisplay(footer_page_no);
// _DtHelpCleanAndDrawWholeCanvas((XtPointer)gHelpDisplayArea);
XpEndPage(XtDisplay(pshell));
}
// Print chidren if appropriate
if (print_hierarchy)
{
unsigned int i;
UAS_List<UAS_Common> kids = doc->children();
for (i = 0; i < kids.length(); i++)
{
PrintOneUASCommon(kids[i], pshell, cur_pageP);
}
}
}
示例3: clear_search_hits
void
NodeViewInfo::set_search_hits(UAS_Pointer<UAS_List<UAS_TextRun> >& hits)
{
if (f_current_hit) { // clear search hits previously displayed
clear_search_hits();
}
// retrieve the top container
_DtCvSegment* root_seg;
if ((root_seg = top_container()) == NULL)
return;
unsigned int idx;
for (idx = 0; idx < hits->length(); idx++) { // for each TextRun
UAS_Pointer<UAS_TextRun>& hit = hits->item(idx);
_DtCvSegment* seg;
if ((seg = traverse_for_vcc(root_seg, hit->offset())) == NULL) {
#ifdef DEBUG
fprintf(stderr, "(DEBUG) traverse_for_vcc failed, offset=%d\n",
hit->offset());
#endif
continue;
}
#ifdef DEBUG
else
fprintf(stderr, "(DEBUG) traverse_for_vcc succeeded, offset=%d\n",
hit->offset());
#endif
assert( (seg->type & _DtCvPRIMARY_MASK) == _DtCvSTRING );
if (seg = highlight_search_hit(seg, hit->offset(), hit->length())) {
#ifdef DEBUG
fprintf(stderr, "(DEBUG) highlight_search_hit succeeded, "
"offset=%d\n", hit->offset());
#endif
seg->type |=
_DtCvSEARCH_FLAG | _DtCvSEARCH_BEGIN | _DtCvSEARCH_END;
sr_DtCvSegment* sr_seg = new sr_DtCvSegment(seg);
if (idx == 0) {
seg->type |= _DtCvAPP_FLAG2;
f_current_hit = sr_seg;
}
f_hits.append(sr_seg);
}
#ifdef DEBUG
else
fprintf(stderr, "(DEBUG) highlight_search_hit failed, offset=%d\n",
hit->offset());
#endif
}
}
示例4: rg
void
GraphicsMgr::reattach_graphic(UAS_Pointer<Graphic> &gr)
{
Wait_Cursor bob;
gr->set_detached(FALSE);
ReAttachGraphic rg(gr);
UAS_Sender<ReAttachGraphic>::send_message(rg);
UAS_String locator_str = gr->locator();
GraphicAgent *ga = get_agent(locator_str);
remove_detached(ga);
delete ga;
}
示例5: main
int main (int, char *[]) {
INIT_EXCEPTIONS();
UAS_Common::initialize ();
UAS_List<UAS_String> locList = UAS_Common::rootLocators ();
for (int i = 0; i < locList.length(); i ++) {
UAS_String &cur = locList[i];
UAS_Pointer<UAS_Common> curDoc = UAS_Common::create(cur);
UAS_Pointer<UAS_Collection> curCol = (UAS_Collection *)
((UAS_Common *) curDoc);
printLocs (curCol->root(), 0);
curDoc = curCol->root();
curCol = 0;
UAS_Common::destroy (curDoc);
}
UAS_Common::finalize ();
return 0;
}
示例6:
void
MapAgent::clear_map(UAS_Pointer<UAS_Common> &lib)
{
if(lib->lid() == f_doc_ptr->lid())
{
clear_it();
f_doc_ptr = NULL;
}
}
示例7: UAS_SearchResultsEntry
DtSR_SearchResultsEntry::DtSR_SearchResultsEntry(const char* id,
const char* book,
const char* section,
int dbn, short language,
UAS_Pointer<DtSR_SearchResults>)
: UAS_SearchResultsEntry(id, book, section, Inv_Relevance),
f_dbn(dbn), f_language(language), f_zone(0)
{
int i;
for (i=0; i<=UAS_SearchZones::uas_all; i++)
f_proximity[i] = 0;
UAS_String url("mmdb:LOCATOR=");
url = url + id;
UAS_Pointer<UAS_Common> sec = UAS_Common::create(url);
f_id = sec->locator();
}
示例8: dgl
bool
GraphicsMgr::is_detached(UAS_Pointer<Graphic> &gr)
{
// iterate through the list looking for our graphic.
// if our graphic is in the list, return True.
// Otherwise, return False.
List_Iterator<GraphicAgent*> dgl (&f_detached_list);
for (; dgl; dgl++)
{
UAS_Pointer<Graphic> g = dgl.item()->graphic();
if (gr->locator() == g->locator())
{
return True;
}
}
return False;
}
示例9: printLocs
void
printLocs (UAS_Pointer<UAS_Common> doc, int level) {
for (int i = 0; i < level; i ++)
cerr << " ";
UAS_String theLoc = doc->locator();
if (level >= 2) {
char buf[1024];
UAS_String loc = doc->id();
(void) sprintf (buf, "mmdb:LOCATOR=%s", (char *) loc);
UAS_Pointer<UAS_Common> theDoc = UAS_Common::create(buf);
cerr << (char *) theLoc << ", " << (char *) theDoc->title() << endl;
} else {
cerr << (char *) theLoc << endl;
}
UAS_List<UAS_Common> kids = doc->children();
for (i = 0; i < kids.length(); i ++) {
printLocs (kids[i], level + 1);
}
}
示例10:
UAS_Pointer<UAS_EmbeddedObject>
UAS_Factory::create_embedded (const UAS_String &locator,
UAS_Pointer<UAS_Common> relative_to) {
UAS_Factory *theFactory = get_factory (locator);
if (theFactory != 0) {
return theFactory->create_embedded_object (locator);
} else {
theFactory = get_factory (relative_to->locator());
return theFactory->create_relative_embedded_object(locator,relative_to);
}
}
示例11: operator
void
MarkBase_mmdb::get_marks (UAS_Pointer<UAS_Common> &doc_ptr,
xList<UAS_Pointer<Mark> > &list)
{
#ifdef FUJITSU_OLIAS
UAS_String theId = doc_ptr->bid();
theId = theId + "/" + doc_ptr->id();
#else
UAS_String theId = doc_ptr->id();
#endif
oid_list_handler *l =
f_mark_base->get_mark_list ((char *) theId);
if (l != NULL)
{
for (int i = 1; i <= (*l)->count(); i++)
{
// Pull the entry from the list and replace it with NULL so
// that it doesn't get deleted when the list is deleted.
oid_t id = (*l)-> operator()(i);
// Assure that the oid_t has not been deleted. qfc 7-6-93
if (id.eq (oid_t (c_code_t(0), 0)) == false)
{
try
{
Mark_mmdb *m = find_mark (id, doc_ptr);
list.append (m);
}
catch_any()
{
// ignore failure for now! DJB
}
end_try;
}
}
delete l;
}
}
示例12: bookcaseList
UAS_Pointer<UAS_SearchEngine>
MMDB_Library::search_engine() {
UAS_List<UAS_Common> bookcases = bookcaseList();
UAS_PtrList<const char> cList;
unsigned int i;
#ifdef DEBUG
for (i = 0; i < bookcases.length(); i++)
fprintf(stderr, "(DEBUG) bookcases %d=%s\n",
i, (char*)bookcases[i]->id());
#endif
UAS_List<UAS_String> strings;
for (i = 0; i < bookcases.length(); i++) {
UAS_Pointer<UAS_String> string = new UAS_String;
strings.insert_item(string);
}
for (i = 0; i < bookcases.length(); i++)
{
UAS_Pointer<UAS_Common> infolib = bookcases[i]->parent();
UAS_String str = infolib->id();
str = str + "/" + bookcases[i]->id();
*(UAS_String *)strings[i] = str;
cList.append((char*)(*(UAS_String *)strings[i]));
}
#ifdef DTSEARCH
fSearchEngine = &(DtSR_SearchEngine::search_engine (&cList));
#else
fSearchEngine = &(Fulcrum_SearchEngine::search_engine (&cList));
#endif
return fSearchEngine;
}
示例13: UASbasename
UAS_BookcaseEntry::UAS_BookcaseEntry(UAS_Pointer<UAS_Common> &bookcase,
int searchable)
: f_searchable(searchable),
f_name(0),
f_base_num(-1)
{
const char *bc_path = bookcase->id();
if (! bc_path) {
f_name = f_path = NULL;
}
else {
const char *bc_name = UASbasename(bc_path);
f_name = new char[strlen(bc_name)+1];
strcpy(f_name, bc_name);
f_path = new char[strlen(bc_path)+1];
strcpy (f_path, bc_path);
}
f_infolib_id = bookcase->lid();
f_bookcase_id = bookcase->bid();
}
示例14: LocalHistoryEntry
void
LocalHistoryMgr::append (UAS_Pointer<UAS_Common> &doc_ptr)
{
ON_DEBUG (printf ("&&&&& APPENDING <%s> to history\n", doc_ptr->title()));
LocalHistoryEntry *entry = new LocalHistoryEntry (doc_ptr);
truncate();
entry->f_previous = f_current;
if (f_current != NULL)
f_current = f_current->f_next = entry;
else
{
// Once the first element is set it can never be truncated.
f_first = f_current = entry;
}
entry->f_next = NULL;
}
示例15: printTitles
void
printTitles (UAS_Pointer<UAS_Common> doc, int level) {
int i;
for (i = 0; i < level; i ++)
fprintf (stderr, " ");
fprintf (stderr, "%s\n", (char *) doc->title ());
UAS_Pointer<UAS_Common> curDoc;
if (doc->type() == UAS_BOOK) {
curDoc = doc->next();
while (curDoc != 0) {
fprintf (stderr, "********** %s \n", (char *) curDoc->title ());
curDoc = curDoc->next();
}
} else {
UAS_List<UAS_Common> theList = doc->children ();
for (i = 0; i < theList.length(); i ++)
printTitles (theList[i], level + 1);
}
}