]> git.lyx.org Git - lyx.git/blobdiff - src/LyXView.C
removed a warning from screen and added CFLAGS in lyx.spec.in.
[lyx.git] / src / LyXView.C
index 44121b1f255f5e6b3efd129f9ede9bfa361ed0cb..b9b600c831ceb35686e4e360feb83ee205cdd072 100644 (file)
@@ -22,7 +22,7 @@
 #include "minibuffer.h"
 #include "lyxfunc.h"
 #include "lyx.xpm"
-#include "error.h"
+#include "debug.h"
 #include "layout_forms.h"
 #include "intl.h"
 #include "lyxrc.h"
@@ -46,12 +46,13 @@ int current_layout = 0;
 // This is very temporary
 BufferView *current_view;
 
+extern "C" int C_LyXView_atCloseMainFormCB(FL_FORM *, void *);
 
 LyXView::LyXView(int width, int height)
 {
        fd_form_main = create_form_form_main(width,height);
-       fl_set_form_atclose(_form, atCloseMainFormCB, 0);
-       lyxerr.debug("Initializing LyXFunc");
+       fl_set_form_atclose(_form, C_LyXView_atCloseMainFormCB, 0);
+       lyxerr.debug() << "Initializing LyXFunc" << endl;
        lyxfunc = new LyXFunc(this);
        intl = new Intl;
 }
@@ -69,7 +70,7 @@ LyXView::~LyXView()
 
 /// Redraw the main form.
 void LyXView::redraw() {
-       lyxerr.debug("LyXView::redraw()");
+       lyxerr.debug() << "LyXView::redraw()" << endl;
        fl_redraw_form(_form);
        minibuffer->Activate();
 }
@@ -91,14 +92,25 @@ void LyXView::UpdateTimerCB(FL_OBJECT *ob, long)
        updatetimer = 0;
 }
 
+// Wrapper for the above
+extern "C" void C_LyXView_UpdateTimerCB(FL_OBJECT *ob, long data) {
+       LyXView::UpdateTimerCB(ob,data);
+}
+
+
 
 // Callback for autosave timer
 void LyXView::AutosaveTimerCB(FL_OBJECT *, long)
 {
-       lyxerr.debug("Running AutoSave()");
+       lyxerr.debug() << "Running AutoSave()" << endl;
        AutoSave();
 }
 
+// Wrapper for the above
+extern "C" void C_LyXView_AutosaveTimerCB(FL_OBJECT *ob, long data) {
+       LyXView::AutosaveTimerCB(ob, data);
+}
+
 
 /// Reset autosave timer
 void LyXView::resetAutosaveTimer()
@@ -115,6 +127,11 @@ int LyXView::atCloseMainFormCB(FL_FORM *, void *)
        return FL_IGNORE;
 }
 
+// Wrapper for the above
+extern "C" int C_LyXView_atCloseMainFormCB(FL_FORM *form, void *p) {
+       return LyXView::atCloseMainFormCB(form,p);
+}
+
 
 void LyXView::setPosition(int x, int y)
 {
@@ -198,12 +215,12 @@ FD_form_main *LyXView::create_form_form_main(int width, int height)
        // timer_autosave
        fdui->timer_autosave = obj = fl_add_timer(FL_HIDDEN_TIMER,
                                                  0,0,0,0,"Timer");
-       fl_set_object_callback(obj,AutosaveTimerCB,0);
+       fl_set_object_callback(obj,C_LyXView_AutosaveTimerCB,0);
        
        // timer_update
        fdui->timer_update = obj = fl_add_timer(FL_HIDDEN_TIMER,
                                                0,0,0,0,"Timer");
-       fl_set_object_callback(obj,UpdateTimerCB,0);
+       fl_set_object_callback(obj,C_LyXView_UpdateTimerCB,0);
        obj->u_vdata = (void*) this;
 
        //
@@ -231,6 +248,7 @@ FD_form_main *LyXView::create_form_form_main(int width, int height)
        return fdui;
 }
 
+extern "C" int C_LyXView_KeyPressMask_raw_callback(FL_FORM *fl, void *xev);
 
 void LyXView::init()
 {
@@ -247,7 +265,7 @@ void LyXView::init()
        // Install the raw callback for keyboard events 
        fl_register_raw_callback(_form,
                                 KeyPressMask,
-                                KeyPressMask_raw_callback);
+                                C_LyXView_KeyPressMask_raw_callback);
         intl->InitKeyMapper(lyxrc->use_kbmap);
 }
 
@@ -333,6 +351,11 @@ int LyXView::KeyPressMask_raw_callback(FL_FORM *fl, void *xev)
        return retval;
 }
 
+// wrapper for the above
+extern "C" int C_LyXView_KeyPressMask_raw_callback(FL_FORM *fl, void *xev)
+{
+       return LyXView::KeyPressMask_raw_callback(fl, xev);
+}
 
 // Updates the title of the window with the filename of the current document
 void LyXView::updateWindowTitle() {