~ubuntu-branches/debian/sid/gnome-terminal/sid

« back to all changes in this revision

Viewing changes to src/terminal-widget-vte.c

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette
  • Date: 2008-09-18 16:17:00 UTC
  • mfrom: (1.2.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20080918161700-y5snz7to4pl2c5w3
Tags: 2.22.3-3
01_error_crash.patch: stolen from upstream (r2948). Fixes crash when 
passing incorrect arguments to the command line. Closes: #477259.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/*
4
4
 * Copyright (C) 2002 Anders Carlsson <andersca@gnu.org>
5
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,
 
6
 * This file is part of gnome-terminal.
 
7
 *
 
8
 * Gnome-terminal is free software; you can redistribute it and/or modify
 
9
 * it under the terms of the GNU General Public License as published by
 
10
 * the Free Software Foundation; either version 2 of the License, or
 
11
 * (at your option) any later version.
 
12
 *
 
13
 * Gnome-terminal is distributed in the hope that it will be useful,
12
14
 * 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
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
 * GNU General Public License for more details.
15
17
 *
16
 
 * You should have received a copy of the GNU Library General Public
17
 
 * License along with this library; if not, write to the
18
 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
 
 * Boston, MA 02111-1307, USA.
 
18
 * You should have received a copy of the GNU General Public License
 
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
20
 */
21
21
 
22
22
#include "terminal-intl.h"
23
23
#include "terminal-widget.h"
24
24
 
25
25
#include <string.h>
 
26
#include <X11/extensions/Xrender.h>
 
27
 
26
28
#include <vte/vte.h>
27
29
#include <gdk/gdkx.h>
28
30
 
195
197
 
196
198
  match = vte_terminal_match_check(VTE_TERMINAL(widget), column, row, &tag);
197
199
  for (tags = data->url_tags; tags != NULL; tags = g_slist_next(tags))
198
 
    if (GPOINTER_TO_INT(((TagData*)tags->data)->tag) == tag)
199
 
      {
200
 
        if (flavor)
201
 
          *flavor = tag;
202
 
        return match;
203
 
      }
 
200
    {
 
201
      TagData *tag_data = (TagData*) tags->data;
 
202
      if (GPOINTER_TO_INT(tag_data->tag) == tag)
 
203
        {
 
204
          if (flavor)
 
205
            *flavor = tag_data->flavor;
 
206
          return match;
 
207
        }
 
208
    }
204
209
 
205
210
  g_free (match);
206
211
  return NULL;
221
226
 
222
227
  match = vte_terminal_match_check(VTE_TERMINAL(widget), column, row, &tag);
223
228
  for (tags = data->skey_tags; tags != NULL; tags = g_slist_next(tags))
224
 
    if (GPOINTER_TO_INT(((TagData*)tags->data)->tag) == tag)
225
 
      {
226
 
        if (flavor)
227
 
          *flavor = tag;
228
 
        return match;
229
 
      }
 
229
    {
 
230
      TagData *tag_data = (TagData*) tags->data;
 
231
      if (GPOINTER_TO_INT(tag_data->tag) == tag)
 
232
        {
 
233
          if (flavor)
 
234
            *flavor = tag_data->flavor;
 
235
          return match;
 
236
        }
 
237
    }
230
238
 
231
239
  g_free (match);
232
240
  return NULL;
351
359
terminal_widget_set_background_transparent (GtkWidget *widget,
352
360
                                            gboolean   setting)
353
361
{
 
362
    /* FIXME: Don't enable this if we have a compmgr. */
354
363
  vte_terminal_set_background_transparent(VTE_TERMINAL(widget), setting);
355
364
}
356
365
 
364
373
}
365
374
 
366
375
void
 
376
terminal_widget_set_background_opacity (GtkWidget *widget,
 
377
                                        double     factor)
 
378
{
 
379
  g_return_if_fail(VTE_IS_TERMINAL(widget));
 
380
  vte_terminal_set_opacity(VTE_TERMINAL(widget), factor * 0xffff);
 
381
}
 
382
 
 
383
void
367
384
terminal_widget_set_background_scrolls (GtkWidget *widget,
368
385
                                        gboolean   setting)
369
386
{
616
633
 
617
634
      dpy = gdk_x11_display_get_xdisplay (gdk_display_get_default ());
618
635
      has_render = (XRenderQueryExtension (dpy, &event_base, &error_base) &&
619
 
                    (XRenderFindVisualFormat (dpy, DefaultVisual (dpy, DefaultScreen (dpy))) != 0));
 
636
                    (XRenderFindVisualFormat (dpy, DefaultVisual (dpy, DefaultScreen (dpy))) != NULL));
620
637
 
621
638
      if (has_render)
622
639
        vte_terminal_set_font (VTE_TERMINAL (widget), font_desc);
627
644
    }
628
645
}
629
646
 
630
 
gboolean
631
 
terminal_widget_supports_pango_fonts (void)
632
 
{
633
 
  return TRUE;
634
 
}
635
 
 
636
647
const char*
637
648
terminal_widget_get_encoding (GtkWidget *widget)
638
649
{