~ubuntu-branches/ubuntu/vivid/gtkhtml4.0/vivid-proposed

« back to all changes in this revision

Viewing changes to gtkhtml/htmlengine-edit-fontstyle.c

  • Committer: Package Import Robot
  • Author(s): Josselin Mouette
  • Date: 2011-12-16 19:49:17 UTC
  • mfrom: (1.1.4) (3.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20111216194917-giursnttx0kru23g
Tags: 4.2.2-1
* New upstream release.
* 01_deprecated.patch: patch from upstream git. Don’t use 
  _DISABLE_DEPRECATED flags.
* Use dh-autoreconf.
* Update Vcs-* fields.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
2
/* This file is part of the GtkHTML library
3
 
 
4
 
   Copyright (C) 2000 Helix Code, Inc.
5
 
 
6
 
   This library is free software; you can redistribute it and/or
7
 
   modify it under the terms of the GNU Library General Public
8
 
   License as published by the Free Software Foundation; either
9
 
   version 2 of the License, or (at your option) any later version.
10
 
 
11
 
   This library is distributed in the hope that it will be useful,
12
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
   Library General Public License for more details.
15
 
 
16
 
   You should have received a copy of the GNU Library General Public License
17
 
   along with this library; see the file COPYING.LIB.  If not, write to
18
 
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
 
   Boston, MA 02110-1301, USA.
 
3
 *
 
4
 * Copyright (C) 2000 Helix Code, Inc.
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU Library General Public
 
8
 * License as published by the Free Software Foundation; either
 
9
 * version 2 of the License, or (at your option) any later version.
 
10
 *
 
11
 * This library is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 * Library General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Library General Public License
 
17
 * along with this library; see the file COPYING.LIB.  If not, write to
 
18
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
19
 * Boston, MA 02110-1301, USA.
20
20
*/
21
21
 
22
22
#include <config.h>
276
276
};
277
277
 
278
278
static void
279
 
object_set_font_style (HTMLObject *o, HTMLEngine *e, gpointer data)
 
279
object_set_font_style (HTMLObject *o,
 
280
                       HTMLEngine *e,
 
281
                       gpointer data)
280
282
{
281
283
        if (html_object_is_text (o)) {
282
284
                struct tmp_font *tf = (struct tmp_font *) data;
297
299
static void set_empty_flow_style (HTMLEngine *e, GtkHTMLFontStyle and_mask, GtkHTMLFontStyle or_mask, HTMLUndoDirection dir);
298
300
 
299
301
static void
300
 
set_empty_flow_style_undo_action (HTMLEngine *e, HTMLUndoData *undo_data, HTMLUndoDirection dir, guint position_after)
 
302
set_empty_flow_style_undo_action (HTMLEngine *e,
 
303
                                  HTMLUndoData *undo_data,
 
304
                                  HTMLUndoDirection dir,
 
305
                                  guint position_after)
301
306
{
302
307
        HTMLEmptyParaSetStyle *undo = (HTMLEmptyParaSetStyle *) undo_data;
303
308
 
305
310
}
306
311
 
307
312
static void
308
 
set_empty_flow_style (HTMLEngine *e, GtkHTMLFontStyle and_mask, GtkHTMLFontStyle or_mask, HTMLUndoDirection dir)
 
313
set_empty_flow_style (HTMLEngine *e,
 
314
                      GtkHTMLFontStyle and_mask,
 
315
                      GtkHTMLFontStyle or_mask,
 
316
                      HTMLUndoDirection dir)
309
317
{
310
318
        HTMLEmptyParaSetStyle *undo;
311
319
        GtkHTMLFontStyle old_or_mask;
329
337
 
330
338
gboolean
331
339
html_engine_set_font_style (HTMLEngine *e,
332
 
                            GtkHTMLFontStyle and_mask,
333
 
                            GtkHTMLFontStyle or_mask)
 
340
                            GtkHTMLFontStyle and_mask,
 
341
                            GtkHTMLFontStyle or_mask)
334
342
{
335
343
        gboolean rv;
336
344
        GtkHTMLFontStyle old = e->insertion_font_style;
365
373
}
366
374
 
367
375
gboolean
368
 
html_engine_toggle_font_style (HTMLEngine *engine, GtkHTMLFontStyle style)
 
376
html_engine_toggle_font_style (HTMLEngine *engine,
 
377
                               GtkHTMLFontStyle style)
369
378
{
370
379
        GtkHTMLFontStyle cur_style;
371
380
 
378
387
}
379
388
 
380
389
static GtkHTMLFontStyle
381
 
inc_dec_size (GtkHTMLFontStyle style, gboolean inc)
 
390
inc_dec_size (GtkHTMLFontStyle style,
 
391
              gboolean inc)
382
392
{
383
393
        GtkHTMLFontStyle size;
384
394
 
398
408
}
399
409
 
400
410
static void
401
 
inc_dec_size_cb (HTMLObject *o, HTMLEngine *e, gpointer data)
 
411
inc_dec_size_cb (HTMLObject *o,
 
412
                 HTMLEngine *e,
 
413
                 gpointer data)
402
414
{
403
415
        if (html_object_is_text (o)) {
404
416
                html_text_set_font_style (HTML_TEXT (o), e, inc_dec_size (HTML_TEXT (o)->font_style, GPOINTER_TO_INT (data)));
408
420
}
409
421
 
410
422
void
411
 
html_engine_font_size_inc_dec (HTMLEngine *e, gboolean inc)
 
423
html_engine_font_size_inc_dec (HTMLEngine *e,
 
424
                               gboolean inc)
412
425
{
413
426
        if (html_engine_is_selection_active (e))
414
427
                html_engine_cut_and_paste (e,
420
433
}
421
434
 
422
435
static void
423
 
set_color (HTMLObject *o, HTMLEngine *e, gpointer data)
 
436
set_color (HTMLObject *o,
 
437
           HTMLEngine *e,
 
438
           gpointer data)
424
439
{
425
440
        if (html_object_is_text (o)) {
426
441
                HTMLObject *prev;
437
452
}
438
453
 
439
454
gboolean
440
 
html_engine_set_color (HTMLEngine *e, HTMLColor *color)
 
455
html_engine_set_color (HTMLEngine *e,
 
456
                       HTMLColor *color)
441
457
{
442
458
        gboolean rv = TRUE;
443
459
 
459
475
}
460
476
 
461
477
/* URL/Target
462
 
 
463
 
   get actual url/target
 
478
 *
 
479
 * get actual url/target
464
480
*/
465
481
 
466
482
const gchar *
476
492
}
477
493
 
478
494
void
479
 
html_engine_set_url (HTMLEngine *e, const gchar *url)
 
495
html_engine_set_url (HTMLEngine *e,
 
496
                     const gchar *url)
480
497
{
481
498
        if (e->insertion_url)
482
499
                g_free (e->insertion_url);
484
501
}
485
502
 
486
503
void
487
 
html_engine_set_target (HTMLEngine *e, const gchar *target)
 
504
html_engine_set_target (HTMLEngine *e,
 
505
                        const gchar *target)
488
506
{
489
507
        if (e->insertion_target)
490
508
                g_free (e->insertion_target);
494
512
/* get url/target from document */
495
513
 
496
514
static const gchar *
497
 
get_url_or_target_from_selection (HTMLEngine *e, gboolean get_url)
 
515
get_url_or_target_from_selection (HTMLEngine *e,
 
516
                                  gboolean get_url)
498
517
{
499
518
        const gchar *str = NULL;
500
519
        HTMLPoint p;
519
538
}
520
539
 
521
540
static HTMLObject *
522
 
html_engine_text_style_object (HTMLEngine *e, gint *offset)
 
541
html_engine_text_style_object (HTMLEngine *e,
 
542
                               gint *offset)
523
543
{
524
544
        if (HTML_IS_TEXT (e->cursor->object)
525
545
            || (e->cursor->offset && e->cursor->offset != html_object_get_length (e->cursor->object))) {