Remove spurious fl_get_freebrowser_browser accessor function.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6699 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-04-03 09:48:03 +00:00
parent 6342052576
commit f5d175ff40
5 changed files with 28 additions and 35 deletions

View File

@ -1,3 +1,11 @@
2003-04-03 Angus Leeming <leeming@lyx.org>
* freebrowser.[ch] (fl_get_freebrowser_browser): removed spurious
accessor function.
* XMinibuffer.C:
* combox.c: associated changes.
2003-04-03 Angus Leeming <leeming@lyx.org>
* combox.[ch]: add an FL_NORMAL_COMBOX type.

View File

@ -43,8 +43,6 @@ FL_OBJECT * create_input_box(void * parent, int type,
FL_FREEBROWSER * create_freebrowser(void * parent);
FL_OBJECT * get_freebrowser_browser(boost::shared_ptr<FL_FREEBROWSER> &);
} // namespace anon
@ -89,7 +87,7 @@ void XMiniBuffer::freebrowserCB(int action)
} else {
// Fill the input widget with the selected
// browser entry.
FL_OBJECT * browser = get_freebrowser_browser(freebrowser_);
FL_OBJECT * browser = freebrowser_->browser;
string const str = getString(browser);
if (!str.empty()) {
@ -172,8 +170,7 @@ int XMiniBuffer::peek_event(FL_OBJECT * ob, int event,
// Fill freebrowser_'s browser with the list of
// available completions
FL_OBJECT * browser =
get_freebrowser_browser(freebrowser_);
FL_OBJECT * browser = freebrowser_->browser;
fl_clear_browser(browser);
vector<string>::const_iterator cit = comp.begin();
vector<string>::const_iterator end = comp.end();
@ -351,10 +348,4 @@ FL_FREEBROWSER * create_freebrowser(void * parent)
return fb;
}
FL_OBJECT * get_freebrowser_browser(boost::shared_ptr<FL_FREEBROWSER> & fb)
{
FL_FREEBROWSER * ptr = fb.get();
return ptr ? fl_get_freebrowser_browser(ptr) : 0;
}
} // namespace anon

View File

@ -25,7 +25,7 @@ typedef struct {
/** A pointer to the parent widget */
FL_OBJECT * combox;
FL_FREEBROWSER * browser;
FL_FREEBROWSER * freebrowser;
int browser_height;
/** The browser will be displayed either below or above the main body. */
@ -87,8 +87,8 @@ FL_OBJECT * fl_create_combox(FL_COMBOX_TYPE type,
sp->browser_height = 100;
sp->browser_position = FL_FREEBROWSER_BELOW;
sp->browser = fl_create_freebrowser(sp);
sp->browser->callback = update_button_chosen;
sp->freebrowser = fl_create_freebrowser(sp);
sp->freebrowser->callback = update_button_chosen;
sp->button_state = 0;
if (type == FL_DROPLIST_COMBOX) {
@ -174,7 +174,7 @@ void fl_clear_combox(FL_OBJECT * ob)
return;
sp = ob->spec;
browser = fl_get_freebrowser_browser(sp->browser);
browser = sp->freebrowser->browser;
fl_clear_browser(browser);
fl_set_object_label(sp->button_chosen, "");
@ -193,7 +193,7 @@ void fl_addto_combox(FL_OBJECT * ob, char const * text)
return;
sp = ob->spec;
browser = fl_get_freebrowser_browser(sp->browser);
browser = sp->freebrowser->browser;
/* Split the string on '|' boundaries. */
i = j = 0;
@ -232,7 +232,7 @@ void fl_set_combox(FL_OBJECT * ob, int sel)
return;
sp = ob->spec;
browser = fl_get_freebrowser_browser(sp->browser);
browser = sp->freebrowser->browser;
if (sel < 1 || sel > fl_get_browser_maxline(browser))
return;
@ -251,7 +251,7 @@ int fl_get_combox(FL_OBJECT * ob)
return 0;
sp = ob->spec;
browser = fl_get_freebrowser_browser(sp->browser);
browser = sp->freebrowser->browser;
return fl_get_browser(browser);
}
@ -278,7 +278,7 @@ char const * fl_get_combox_line(FL_OBJECT * ob, int line)
return 0;
sp = ob->spec;
browser = fl_get_freebrowser_browser(sp->browser);
browser = sp->freebrowser->browser;
maxlines = fl_get_browser_maxline(browser);
if (line > maxlines)
@ -297,7 +297,7 @@ int fl_get_combox_maxitems(FL_OBJECT * ob)
return 0;
sp = ob->spec;
browser = fl_get_freebrowser_browser(sp->browser);
browser = sp->freebrowser->browser;
return fl_get_browser_maxline(browser);
}
@ -319,7 +319,7 @@ void fl_hide_combox_browser(FL_OBJECT * ob)
return;
sp = ob->spec;
fl_free_freebrowser(sp->browser);
fl_free_freebrowser(sp->freebrowser);
}
@ -363,7 +363,7 @@ static int combox_handle(FL_OBJECT * ob, int event, FL_Coord mx, FL_Coord my,
break;
case FL_FREEMEM: {
COMBOX_SPEC * sp = ob->spec;
fl_free_freebrowser(sp->browser);
fl_free_freebrowser(sp->freebrowser);
/* children take care of themselves, but we must make sure that
sp itself is free-d eventually. */
fl_addto_freelist(sp);
@ -402,7 +402,7 @@ static void show_browser(COMBOX_SPEC * sp)
abs_y += (sp->browser_position == FL_FREEBROWSER_BELOW) ? ob->h : -bh;
set_state_label(sp, COMBOX_OPEN);
fl_show_freebrowser(sp->browser, abs_x, abs_y, bw, bh);
fl_show_freebrowser(sp->freebrowser, abs_x, abs_y, bw, bh);
}
@ -422,7 +422,7 @@ static void update_button_chosen(FL_FREEBROWSER * fb, int action)
{
COMBOX_SPEC * sp = fb->parent;
FL_OBJECT * browser = fl_get_freebrowser_browser(sp->browser);
FL_OBJECT * browser = sp->freebrowser->browser;
FL_OBJECT * combox = sp->combox;
if (!browser || !combox) return;

View File

@ -116,12 +116,6 @@ void fl_hide_freebrowser(FL_FREEBROWSER * fb)
}
FL_OBJECT * fl_get_freebrowser_browser(FL_FREEBROWSER * fb)
{
return fb->browser;
}
static void browser_cb(FL_OBJECT * ob, long data)
{
FL_FREEBROWSER * fb = ob->u_vdata;

View File

@ -39,10 +39,13 @@ typedef struct fl_freebrowser_ {
/** Is set only if want_printable is true. */
char last_printable;
/** Details of the implementation. */
/** The "owner" of the freebrowser. Not used by the struct. */
void * parent;
FL_FORM * form;
/** The browser itself. */
FL_OBJECT * browser;
/** Details of the implementation. */
FL_FORM * form;
Window save_window;
} FL_FREEBROWSER;
@ -63,9 +66,6 @@ FL_EXPORT void fl_show_freebrowser(FL_FREEBROWSER *,
FL_EXPORT void fl_hide_freebrowser(FL_FREEBROWSER *);
/** Return the browser itself. */
FL_EXPORT FL_OBJECT * fl_get_freebrowser_browser(FL_FREEBROWSER *);
#if defined(__cplusplus)
}
#endif