~latexila/ubuntu/precise/latexila/2.4.0

« back to all changes in this revision

Viewing changes to src/C/document_tab.c

  • Committer: Package Import Robot
  • Author(s): Leo Iannacone, Leo Iannacone, Mahyuddin Susanto
  • Date: 2012-01-17 23:47:30 UTC
  • mfrom: (1.1.7) (7.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120117234730-nlueft6ctrjzjyix
Tags: 2.2.2-1ubuntu1
[ Leo Iannacone ]
* Merge from Debian testing (LP: #913151).  Remaining changes:
  + debian/rules: 
    - override_dh_auto_configure passing -DWITH_GNOME=ON as a better
      integration with GNOME and gsettings-desktop-schemas
  + debian/control:
    - added texlive-latex-recommended, hicolor-icon-theme as
      recommended packages
    - moved rubber from depends to suggested
    - added texlive-latex-extra as suggested
* All other Ubuntu changes are dropped as no longer needed, or have
  been imported in the last debian packages.

[ Mahyuddin Susanto ]
* debian/control: Fix typos, Suggest -> Suggests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
#define TYPE_PROJECT (project_get_type ())
79
79
typedef struct _Project Project;
80
80
#define _project_free0(var) ((var == NULL) ? NULL : (var = (project_free (var), NULL)))
81
 
typedef struct _Block21Data Block21Data;
 
81
typedef struct _Block1Data Block1Data;
82
82
 
83
83
struct _DocumentTab {
84
84
        GtkVBox parent_instance;
117
117
        GFile* main_file;
118
118
};
119
119
 
120
 
struct _Block21Data {
 
120
struct _Block1Data {
121
121
        int _ref_count_;
122
122
        DocumentTab * self;
123
123
        TabInfoBar* infobar;
154
154
void document_load (Document* self, GFile* location);
155
155
DocumentTab* document_tab_new_with_view (DocumentView* view);
156
156
DocumentTab* document_tab_construct_with_view (GType object_type, DocumentView* view);
157
 
static void _lambda26_ (DocumentTab* self);
 
157
static void _lambda95_ (DocumentTab* self);
158
158
static void document_tab_update_label_text (DocumentTab* self);
159
159
static void document_tab_update_label_tooltip (DocumentTab* self);
160
 
static void __lambda26__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 
160
static void __lambda95__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
161
161
static void _document_tab_update_label_tooltip_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
162
162
static void _document_tab_update_label_text_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
163
 
static void _lambda27_ (GtkTextBuffer* s, DocumentTab* self);
 
163
static void _lambda96_ (GtkTextBuffer* s, DocumentTab* self);
164
164
gboolean document_get_modified (Document* self);
165
 
static void __lambda27__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self);
 
165
static void __lambda96__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self);
166
166
DocumentView* document_tab_get_view (DocumentTab* self);
167
167
static gboolean document_tab_view_focused_in (DocumentTab* self);
168
168
static gboolean _document_tab_view_focused_in_gtk_widget_focus_in_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self);
169
 
static void _lambda29_ (DocumentTab* self);
170
 
static void __lambda29__gtk_button_clicked (GtkButton* _sender, gpointer self);
 
169
static void _lambda98_ (DocumentTab* self);
 
170
static void __lambda98__gtk_button_clicked (GtkButton* _sender, gpointer self);
171
171
void document_tab_set_auto_save (DocumentTab* self, gboolean value);
172
172
void document_tab_set_auto_save_interval (DocumentTab* self, guint value);
173
173
static gboolean document_tab_install_auto_save_timeout_if_needed (DocumentTab* self);
174
 
static void _lambda30_ (DocumentTab* self);
175
 
static void __lambda30__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 
174
static void _lambda99_ (DocumentTab* self);
 
175
static void __lambda99__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
176
176
GType tab_info_bar_get_type (void) G_GNUC_CONST;
177
177
TabInfoBar* document_tab_add_message (DocumentTab* self, const gchar* primary_msg, const gchar* secondary_msg, GtkMessageType msg_type);
178
178
TabInfoBar* tab_info_bar_new (const gchar* primary_msg, const gchar* secondary_msg, GtkMessageType msg_type);
195
195
gchar* document_tab_get_menu_tip (DocumentTab* self);
196
196
gboolean document_is_local (Document* self);
197
197
gboolean document_is_externally_modified (Document* self);
198
 
static Block21Data* block21_data_ref (Block21Data* _data21_);
199
 
static void block21_data_unref (Block21Data* _data21_);
 
198
static Block1Data* block1_data_ref (Block1Data* _data1_);
 
199
static void block1_data_unref (Block1Data* _data1_);
200
200
void tab_info_bar_add_stock_button_with_text (TabInfoBar* self, const gchar* text, const gchar* stock_id, gint response_id);
201
 
static void _lambda28_ (gint response_id, Block21Data* _data21_);
202
 
static void __lambda28__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self);
 
201
static void _lambda97_ (gint response_id, Block1Data* _data1_);
 
202
static void __lambda97__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self);
203
203
static void document_tab_install_auto_save_timeout (DocumentTab* self);
204
204
gboolean document_tab_get_auto_save (DocumentTab* self);
205
205
guint document_tab_get_auto_save_interval (DocumentTab* self);
276
276
}
277
277
 
278
278
 
279
 
static void _lambda26_ (DocumentTab* self) {
 
279
static void _lambda95_ (DocumentTab* self) {
280
280
        document_tab_update_label_text (self);
281
281
        document_tab_update_label_tooltip (self);
282
282
}
283
283
 
284
284
 
285
 
static void __lambda26__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
286
 
        _lambda26_ (self);
 
285
static void __lambda95__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
 
286
        _lambda95_ (self);
287
287
}
288
288
 
289
289
 
297
297
}
298
298
 
299
299
 
300
 
static void _lambda27_ (GtkTextBuffer* s, DocumentTab* self) {
 
300
static void _lambda96_ (GtkTextBuffer* s, DocumentTab* self) {
301
301
        const gchar* _tmp0_ = NULL;
302
302
        gboolean _tmp1_;
303
303
        g_return_if_fail (s != NULL);
311
311
}
312
312
 
313
313
 
314
 
static void __lambda27__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self) {
315
 
        _lambda27_ (_sender, self);
 
314
static void __lambda96__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self) {
 
315
        _lambda96_ (_sender, self);
316
316
}
317
317
 
318
318
 
323
323
}
324
324
 
325
325
 
326
 
static void _lambda29_ (DocumentTab* self) {
 
326
static void _lambda98_ (DocumentTab* self) {
327
327
        g_signal_emit_by_name (self, "close-document");
328
328
}
329
329
 
330
330
 
331
 
static void __lambda29__gtk_button_clicked (GtkButton* _sender, gpointer self) {
332
 
        _lambda29_ (self);
 
331
static void __lambda98__gtk_button_clicked (GtkButton* _sender, gpointer self) {
 
332
        _lambda98_ (self);
333
333
}
334
334
 
335
335
 
336
 
static void _lambda30_ (DocumentTab* self) {
 
336
static void _lambda99_ (DocumentTab* self) {
337
337
        if (self->priv->auto_save_timeout <= 0) {
338
338
                document_tab_install_auto_save_timeout_if_needed (self);
339
339
        }
340
340
}
341
341
 
342
342
 
343
 
static void __lambda30__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
344
 
        _lambda30_ (self);
 
343
static void __lambda99__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
 
344
        _lambda99_ (self);
345
345
}
346
346
 
347
347
 
365
365
        _tmp0_ = _g_object_ref0 (self);
366
366
        _g_object_unref0 (self->priv->_document->tab);
367
367
        self->priv->_document->tab = _tmp0_;
368
 
        g_signal_connect_object ((GObject*) self->priv->_document, "notify::location", (GCallback) __lambda26__g_object_notify, self, 0);
 
368
        g_signal_connect_object ((GObject*) self->priv->_document, "notify::location", (GCallback) __lambda95__g_object_notify, self, 0);
369
369
        g_signal_connect_object ((GObject*) self->priv->_document, "notify::project-id", (GCallback) _document_tab_update_label_tooltip_g_object_notify, self, 0);
370
370
        g_signal_connect_object ((GObject*) self->priv->_document, "notify::unsaved-document-n", (GCallback) _document_tab_update_label_text_g_object_notify, self, 0);
371
 
        g_signal_connect_object ((GtkTextBuffer*) self->priv->_document, "modified-changed", (GCallback) __lambda27__gtk_text_buffer_modified_changed, self, 0);
 
371
        g_signal_connect_object ((GtkTextBuffer*) self->priv->_document, "modified-changed", (GCallback) __lambda96__gtk_text_buffer_modified_changed, self, 0);
372
372
        g_signal_connect_object ((GtkWidget*) self->priv->_view, "focus-in-event", (GCallback) _document_tab_view_focused_in_gtk_widget_focus_in_event, self, 0);
373
373
        _tmp1_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
374
374
        sw = g_object_ref_sink (_tmp1_);
392
392
        _tmp5_ = g_object_ref_sink (_tmp4_);
393
393
        gtk_container_add ((GtkContainer*) close_button, (GtkWidget*) _tmp5_);
394
394
        _g_object_unref0 (_tmp5_);
395
 
        g_signal_connect_object (close_button, "clicked", (GCallback) __lambda29__gtk_button_clicked, self, 0);
 
395
        g_signal_connect_object (close_button, "clicked", (GCallback) __lambda98__gtk_button_clicked, self, 0);
396
396
        _tmp6_ = (GtkHBox*) gtk_hbox_new (FALSE, 0);
397
397
        _g_object_unref0 (self->priv->_label);
398
398
        self->priv->_label = g_object_ref_sink (_tmp6_);
408
408
        g_settings_get (settings, "auto-save-interval", "u", &tmp);
409
409
        document_tab_set_auto_save_interval (self, tmp);
410
410
        document_tab_install_auto_save_timeout_if_needed (self);
411
 
        g_signal_connect_object ((GObject*) self->priv->_document, "notify::location", (GCallback) __lambda30__g_object_notify, self, 0);
 
411
        g_signal_connect_object ((GObject*) self->priv->_document, "notify::location", (GCallback) __lambda99__g_object_notify, self, 0);
412
412
        _g_object_unref0 (settings);
413
413
        _g_object_unref0 (close_button);
414
414
        _g_object_unref0 (sw);
599
599
}
600
600
 
601
601
 
602
 
static Block21Data* block21_data_ref (Block21Data* _data21_) {
603
 
        g_atomic_int_inc (&_data21_->_ref_count_);
604
 
        return _data21_;
 
602
static Block1Data* block1_data_ref (Block1Data* _data1_) {
 
603
        g_atomic_int_inc (&_data1_->_ref_count_);
 
604
        return _data1_;
605
605
}
606
606
 
607
607
 
608
 
static void block21_data_unref (Block21Data* _data21_) {
609
 
        if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
610
 
                _g_object_unref0 (_data21_->self);
611
 
                _g_object_unref0 (_data21_->infobar);
612
 
                g_slice_free (Block21Data, _data21_);
 
608
static void block1_data_unref (Block1Data* _data1_) {
 
609
        if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
 
610
                _g_object_unref0 (_data1_->self);
 
611
                _g_object_unref0 (_data1_->infobar);
 
612
                g_slice_free (Block1Data, _data1_);
613
613
        }
614
614
}
615
615
 
616
616
 
617
 
static void _lambda28_ (gint response_id, Block21Data* _data21_) {
 
617
static void _lambda97_ (gint response_id, Block1Data* _data1_) {
618
618
        DocumentTab * self;
619
 
        self = _data21_->self;
 
619
        self = _data1_->self;
620
620
        if (response_id == GTK_RESPONSE_OK) {
621
621
                GFile* _tmp0_ = NULL;
622
622
                _tmp0_ = document_get_location (self->priv->_document);
623
623
                document_load (self->priv->_document, _tmp0_);
624
624
                self->priv->ask_if_externally_modified = FALSE;
625
625
        }
626
 
        gtk_object_destroy ((GtkObject*) _data21_->infobar);
 
626
        gtk_object_destroy ((GtkObject*) _data1_->infobar);
627
627
        gtk_widget_grab_focus ((GtkWidget*) self->priv->_view);
628
628
}
629
629
 
630
630
 
631
 
static void __lambda28__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self) {
632
 
        _lambda28_ (response_id, self);
 
631
static void __lambda97__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self) {
 
632
        _lambda97_ (response_id, self);
633
633
}
634
634
 
635
635
 
649
649
        }
650
650
        _tmp1_ = document_is_externally_modified (self->priv->_document);
651
651
        if (_tmp1_) {
652
 
                Block21Data* _data21_;
 
652
                Block1Data* _data1_;
653
653
                const gchar* _tmp2_ = NULL;
654
654
                GFile* _tmp3_ = NULL;
655
655
                gchar* _tmp4_ = NULL;
661
661
                gboolean _tmp8_;
662
662
                TabInfoBar* _tmp13_ = NULL;
663
663
                const gchar* _tmp14_ = NULL;
664
 
                _data21_ = g_slice_new0 (Block21Data);
665
 
                _data21_->_ref_count_ = 1;
666
 
                _data21_->self = g_object_ref (self);
 
664
                _data1_ = g_slice_new0 (Block1Data);
 
665
                _data1_->_ref_count_ = 1;
 
666
                _data1_->self = g_object_ref (self);
667
667
                self->priv->ask_if_externally_modified = TRUE;
668
668
                _tmp2_ = _ ("The file %s changed on disk.");
669
669
                _tmp3_ = document_get_location (self->priv->_document);
690
690
                        secondary_msg = _tmp12_;
691
691
                }
692
692
                _tmp13_ = document_tab_add_message (self, primary_msg, secondary_msg, GTK_MESSAGE_WARNING);
693
 
                _data21_->infobar = _tmp13_;
 
693
                _data1_->infobar = _tmp13_;
694
694
                _tmp14_ = _ ("Reload");
695
 
                tab_info_bar_add_stock_button_with_text (_data21_->infobar, _tmp14_, GTK_STOCK_REFRESH, (gint) GTK_RESPONSE_OK);
696
 
                gtk_info_bar_add_button ((GtkInfoBar*) _data21_->infobar, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL);
697
 
                g_signal_connect_data ((GtkInfoBar*) _data21_->infobar, "response", (GCallback) __lambda28__gtk_info_bar_response, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
 
695
                tab_info_bar_add_stock_button_with_text (_data1_->infobar, _tmp14_, GTK_STOCK_REFRESH, (gint) GTK_RESPONSE_OK);
 
696
                gtk_info_bar_add_button ((GtkInfoBar*) _data1_->infobar, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL);
 
697
                g_signal_connect_data ((GtkInfoBar*) _data1_->infobar, "response", (GCallback) __lambda97__gtk_info_bar_response, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
698
698
                _g_free0 (secondary_msg);
699
699
                _g_free0 (primary_msg);
700
 
                block21_data_unref (_data21_);
701
 
                _data21_ = NULL;
 
700
                block1_data_unref (_data1_);
 
701
                _data1_ = NULL;
702
702
        }
703
703
        result = FALSE;
704
704
        return result;