[Xfce4-commits] [apps/xfce4-terminal] 02/05: use vte3, builds but does not run

noreply at xfce.org noreply at xfce.org
Wed Jun 1 00:37:35 CEST 2016


This is an automated email from the git hooks/post-receive script.

ochosi pushed a commit to branch master
in repository apps/xfce4-terminal.

commit 2b1551dcb96b1194de1a906851adb92863ec8743
Author: minus <minus at mnus.de>
Date:   Tue Mar 31 19:29:43 2015 +0200

    use vte3, builds but does not run
    
    Signed-off-by: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
---
 configure.ac.in                 |  2 +-
 terminal/terminal-preferences.c |  4 +-
 terminal/terminal-preferences.h |  2 +-
 terminal/terminal-screen.c      | 93 +++++++++++++++++++++++------------------
 terminal/terminal-widget.c      | 11 +++--
 terminal/terminal-window.c      | 14 +++----
 6 files changed, 71 insertions(+), 55 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 68a1bec..23022da 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -87,7 +87,7 @@ dnl ***********************************
 dnl *** Check for required packages ***
 dnl ***********************************
 XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.14.0])
-XDT_CHECK_PACKAGE([VTE], [vte], [0.28])
+XDT_CHECK_PACKAGE([VTE], [vte-2.91], [0.38])
 XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.26.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.10.0])
 
diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index dcb223b..3cee3fc 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -1473,7 +1473,7 @@ terminal_preferences_get (void)
 gboolean
 terminal_preferences_get_color (TerminalPreferences *preferences,
                                 const gchar         *property,
-                                GdkColor            *color_return)
+                                GdkRGBA             *color_return)
 {
   gchar    *spec;
   gboolean  succeed = FALSE;
@@ -1482,7 +1482,7 @@ terminal_preferences_get_color (TerminalPreferences *preferences,
 
   g_object_get (G_OBJECT (preferences), property, &spec, NULL);
   if (G_LIKELY (spec != NULL))
-    succeed = gdk_color_parse (spec, color_return);
+    succeed = gdk_rgba_parse (color_return, spec);
   g_free (spec);
 
   return succeed;
diff --git a/terminal/terminal-preferences.h b/terminal/terminal-preferences.h
index 82f1180..cb9cb1d 100644
--- a/terminal/terminal-preferences.h
+++ b/terminal/terminal-preferences.h
@@ -92,7 +92,7 @@ TerminalPreferences *terminal_preferences_get       (void);
 
 gboolean             terminal_preferences_get_color (TerminalPreferences *preferences,
                                                      const gchar         *property,
-                                                     GdkColor            *color_return);
+                                                     GdkRGBA             *color_return);
 
 
 G_END_DECLS
diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 510ad14..0a78fb1 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -281,7 +281,7 @@ terminal_screen_init (TerminalScreen *screen)
       G_CALLBACK (terminal_screen_vte_resize_window), screen);
   gtk_box_pack_start (GTK_BOX (screen), screen->terminal, TRUE, TRUE, 0);
 
-  screen->scrollbar = gtk_vscrollbar_new (VTE_TERMINAL (screen->terminal)->adjustment);
+  screen->scrollbar = gtk_vscrollbar_new (gtk_scrollable_get_vadjustment(GTK_SCROLLABLE (screen->terminal)));
   gtk_box_pack_start (GTK_BOX (screen), screen->scrollbar, FALSE, FALSE, 0);
   g_signal_connect_after (G_OBJECT (screen->scrollbar), "button-press-event", G_CALLBACK (gtk_true), NULL);
   gtk_widget_show (screen->scrollbar);
@@ -387,7 +387,7 @@ terminal_screen_get_property (GObject          *object,
             }
           else if (G_LIKELY (screen->terminal != NULL))
             {
-              title = VTE_TERMINAL (screen->terminal)->window_title;
+              title = vte_terminal_get_window_title(VTE_TERMINAL (screen->terminal));
             }
 
           /* TRANSLATORS: title for the tab/window used when all other
@@ -676,7 +676,7 @@ terminal_screen_parse_title (TerminalScreen *screen,
 
         case 'w':
           /* window title from vte */
-          vte_title = VTE_TERMINAL (screen->terminal)->window_title;
+          vte_title = vte_terminal_get_window_title(VTE_TERMINAL (screen->terminal));
           if (G_UNLIKELY (vte_title == NULL))
             vte_title = _("Untitled");
           g_string_append (string, vte_title);
@@ -778,7 +778,7 @@ terminal_screen_update_background (TerminalScreen *screen)
 
 
 
-static VteTerminalEraseBinding
+static VteEraseBinding
 terminal_screen_binding_vte (TerminalEraseBinding binding)
 {
   switch (binding)
@@ -835,9 +835,12 @@ static void
 terminal_screen_update_encoding (TerminalScreen *screen)
 {
   gchar *encoding;
+  GError *error;
 
   g_object_get (G_OBJECT (screen->preferences), "encoding", &encoding, NULL);
-  vte_terminal_set_encoding (VTE_TERMINAL (screen->terminal), encoding);
+  if (!vte_terminal_set_encoding (VTE_TERMINAL (screen->terminal), encoding, &error)) {
+      g_printerr("Failed to set encoding: %s\n", error->message);
+  }
   g_free (encoding);
 }
 
@@ -846,12 +849,12 @@ terminal_screen_update_encoding (TerminalScreen *screen)
 static void
 terminal_screen_update_colors (TerminalScreen *screen)
 {
-  GdkColor   palette[16];
-  GdkColor   bg;
-  GdkColor   fg;
-  GdkColor   cursor;
-  GdkColor   selection;
-  GdkColor   bold;
+  GdkRGBA    palette[16];
+  GdkRGBA    bg;
+  GdkRGBA    fg;
+  GdkRGBA    cursor;
+  GdkRGBA    selection;
+  GdkRGBA    bold;
   gboolean   selection_use_default;
   gboolean   bold_use_default;
   guint      n = 0;
@@ -880,7 +883,7 @@ terminal_screen_update_colors (TerminalScreen *screen)
 
       if (colors != NULL)
         for (; colors[n] != NULL && n < 16; n++)
-          if (!gdk_color_parse (colors[n], palette + n))
+          if (!gdk_rgba_parse (palette + n, colors[n]))
             {
               g_warning ("Unable to parse color \"%s\".", colors[n]);
               break;
@@ -945,7 +948,8 @@ terminal_screen_update_colors (TerminalScreen *screen)
                  "The default palette has been applied.");
     }
 
-  vte_terminal_set_background_tint_color (VTE_TERMINAL (screen->terminal), has_bg ? &bg : NULL);
+  // TODO: removed functionality? remove if sure
+  //vte_terminal_set_background_tint_color (VTE_TERMINAL (screen->terminal), has_bg ? &bg : NULL);
 
   /* cursor color */
   has_cursor = terminal_preferences_get_color (screen->preferences, "color-cursor", &cursor);
@@ -968,10 +972,11 @@ terminal_screen_update_colors (TerminalScreen *screen)
 static void
 terminal_screen_update_font (TerminalScreen *screen)
 {
-  gboolean             font_allow_bold;
-  gchar               *font_name;
-  glong                grid_w = 0, grid_h = 0;
-  GtkWidget           *toplevel;
+  gboolean               font_allow_bold;
+  gchar                 *font_name;
+  PangoFontDescription  *font_desc;
+  glong                  grid_w = 0, grid_h = 0;
+  GtkWidget             *toplevel;
 
   terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
   terminal_return_if_fail (TERMINAL_IS_PREFERENCES (screen->preferences));
@@ -987,8 +992,10 @@ terminal_screen_update_font (TerminalScreen *screen)
 
   if (G_LIKELY (font_name != NULL))
     {
+      font_desc = pango_font_description_from_string (font_name);
       vte_terminal_set_allow_bold (VTE_TERMINAL (screen->terminal), font_allow_bold);
-      vte_terminal_set_font_from_string (VTE_TERMINAL (screen->terminal), font_name);
+      vte_terminal_set_font(VTE_TERMINAL (screen->terminal), font_desc);
+      pango_font_description_free(font_desc);
       g_free (font_name);
     }
 
@@ -1015,11 +1022,12 @@ terminal_screen_update_misc_bell (TerminalScreen *screen)
 static void
 terminal_screen_update_emulation (TerminalScreen *screen)
 {
-  gchar *emulation;
+  // FIXME: Commented out because I have no idea what happened to this function in VTE
+/*  gchar *emulation;
   g_object_get (G_OBJECT (screen->preferences), "emulation", &emulation, NULL);
   if (g_strcmp0 (emulation, vte_terminal_get_emulation (VTE_TERMINAL (screen->terminal))) != 0)
     vte_terminal_set_emulation (VTE_TERMINAL (screen->terminal), emulation);
-  g_free (emulation);
+  g_free (emulation);*/
 }
 
 
@@ -1039,7 +1047,7 @@ static void
 terminal_screen_update_misc_cursor_shape (TerminalScreen *screen)
 {
   TerminalCursorShape    val;
-  VteTerminalCursorShape shape = VTE_CURSOR_SHAPE_BLOCK;
+  VteCursorShape shape = VTE_CURSOR_SHAPE_BLOCK;
 
   g_object_get (G_OBJECT (screen->preferences), "misc-cursor-shape", &val, NULL);
 
@@ -1163,7 +1171,8 @@ terminal_screen_update_word_chars (TerminalScreen *screen)
   g_object_get (G_OBJECT (screen->preferences), "word-chars", &word_chars, NULL);
   if (G_LIKELY (word_chars != NULL))
     {
-      vte_terminal_set_word_chars (VTE_TERMINAL (screen->terminal), word_chars);
+      // TODO: removed functionality, remove
+      //vte_terminal_set_word_chars (VTE_TERMINAL (screen->terminal), word_chars);
       g_free (word_chars);
     }
 }
@@ -1261,8 +1270,8 @@ terminal_screen_vte_resize_window (VteTerminal    *terminal,
   grid_height = (height - ypad) / char_height;
 
   /* leave if there is nothing to resize */
-  if (terminal->column_count == grid_width
-      && terminal->row_count == grid_height)
+  if (vte_terminal_get_column_count(terminal) == grid_width
+      && vte_terminal_get_column_count(terminal) == grid_height)
     return;
 
   /* set the terminal size and resize the window if it is active */
@@ -1388,9 +1397,9 @@ terminal_screen_timer_background (gpointer user_data)
     {
       loader = terminal_image_loader_get ();
       image = terminal_image_loader_load (loader,
-										  gtk_widget_get_allocated_width (screen->terminal),
-										  gtk_widget_get_allocated_height (screen->terminal));
-      vte_terminal_set_background_image (VTE_TERMINAL (screen->terminal), image);
+                                          gtk_widget_get_allocated_width (screen->terminal),
+                                          gtk_widget_get_allocated_height (screen->terminal));
+      //vte_terminal_set_background_image (VTE_TERMINAL (screen->terminal), image);
       if (G_LIKELY (image != NULL))
         g_object_unref (G_OBJECT (image));
       g_object_unref (G_OBJECT (loader));
@@ -1413,7 +1422,7 @@ terminal_screen_timer_background (gpointer user_data)
         }
 
       /* WARNING: the causes a resize too! */
-      vte_terminal_set_background_image (VTE_TERMINAL (screen->terminal), NULL);
+      //vte_terminal_set_background_image (VTE_TERMINAL (screen->terminal), NULL);
     }
 
   if (G_UNLIKELY (background_mode == TERMINAL_BACKGROUND_IMAGE
@@ -1425,11 +1434,11 @@ terminal_screen_timer_background (gpointer user_data)
       opacity = 0xffff * background_darkness;
     }
 
-  vte_terminal_set_background_saturation (VTE_TERMINAL (screen->terminal), saturation);
-  vte_terminal_set_opacity (VTE_TERMINAL (screen->terminal), opacity);
-  vte_terminal_set_background_transparent (VTE_TERMINAL (screen->terminal),
-                                           background_mode == TERMINAL_BACKGROUND_TRANSPARENT
-                                           && !gtk_widget_is_composited (GTK_WIDGET (screen)));
+  //vte_terminal_set_background_saturation (VTE_TERMINAL (screen->terminal), saturation);
+  //vte_terminal_set_opacity (VTE_TERMINAL (screen->terminal), opacity);
+  //vte_terminal_set_background_transparent (VTE_TERMINAL (screen->terminal),
+  //                                         background_mode == TERMINAL_BACKGROUND_TRANSPARENT
+  //                                         && !gtk_widget_is_composited (GTK_WIDGET (screen)));
 
   GDK_THREADS_LEAVE ();
 
@@ -1543,12 +1552,12 @@ terminal_screen_launch_child (TerminalScreen *screen)
           spawn_flags |= G_SPAWN_FILE_AND_ARGV_ZERO;
         }
 
-      if (!vte_terminal_fork_command_full (VTE_TERMINAL (screen->terminal),
+      if (!vte_terminal_spawn_sync (VTE_TERMINAL (screen->terminal),
                                            update ? VTE_PTY_DEFAULT : VTE_PTY_NO_LASTLOG | VTE_PTY_NO_UTMP | VTE_PTY_NO_WTMP,
                                            screen->working_directory, argv2, env,
                                            spawn_flags,
                                            NULL, NULL,
-                                           &screen->pid, &error))
+                                           &screen->pid, NULL, &error))
         {
           xfce_dialog_show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (screen))),
                                   error, _("Failed to execute child"));
@@ -1807,7 +1816,7 @@ terminal_screen_get_title (TerminalScreen *screen)
   if (G_UNLIKELY (screen->custom_title != NULL))
     return terminal_screen_parse_title (screen, screen->custom_title);
 
-  vte_title = VTE_TERMINAL (screen->terminal)->window_title;
+  vte_title = vte_terminal_get_window_title(VTE_TERMINAL (screen->terminal));
   g_object_get (G_OBJECT (screen->preferences),
                 "title-mode", &mode,
                 "title-initial", &tmp,
@@ -2050,7 +2059,7 @@ terminal_screen_reset (TerminalScreen *screen,
   vte_terminal_reset (VTE_TERMINAL (screen->terminal), TRUE, clear);
 
   if (clear)
-    vte_terminal_search_set_gregex (VTE_TERMINAL (screen->terminal), NULL);
+    vte_terminal_search_set_gregex (VTE_TERMINAL (screen->terminal), NULL, 0);
 }
 
 
@@ -2071,7 +2080,8 @@ terminal_screen_im_append_menuitems (TerminalScreen *screen,
   terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
   terminal_return_if_fail (GTK_IS_MENU_SHELL (menushell));
 
-  vte_terminal_im_append_menuitems (VTE_TERMINAL (screen->terminal), menushell);
+  // FIXME: functionalit seems to have been removed
+  //vte_terminal_im_append_menuitems (VTE_TERMINAL (screen->terminal), menushell);
 }
 
 
@@ -2213,8 +2223,11 @@ void
 terminal_screen_set_encoding (TerminalScreen *screen,
                               const gchar    *charset)
 {
+  GError *error;
   terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
-  vte_terminal_set_encoding (VTE_TERMINAL (screen->terminal), charset);
+  if (!vte_terminal_set_encoding (VTE_TERMINAL (screen->terminal), charset, &error)) {
+    g_printerr("Failed to set encoding: %s\n", error->message);
+  }
 }
 
 
@@ -2225,7 +2238,7 @@ terminal_screen_search_set_gregex (TerminalScreen *screen,
                                    gboolean        wrap_around)
 {
   terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
-  vte_terminal_search_set_gregex (VTE_TERMINAL (screen->terminal), regex);
+  vte_terminal_search_set_gregex (VTE_TERMINAL (screen->terminal), regex, 0);
   vte_terminal_search_set_wrap_around (VTE_TERMINAL (screen->terminal), wrap_around);
 }
 
diff --git a/terminal/terminal-widget.c b/terminal/terminal-widget.c
index 36e6de5..c98abc7 100644
--- a/terminal/terminal-widget.c
+++ b/terminal/terminal-widget.c
@@ -294,7 +294,10 @@ terminal_widget_context_menu (TerminalWidget *widget,
     return;
 
   /* check if we have a match */
-  match = vte_terminal_match_check (terminal, x / terminal->char_width, y / terminal->char_height, &tag);
+  match = vte_terminal_match_check (terminal,
+                                    x / vte_terminal_get_char_width(terminal),
+                                    y / vte_terminal_get_char_height(terminal),
+                                    &tag);
   if (G_UNLIKELY (match != NULL))
     {
       /* prepend a separator to the menu if it does not already contain one */
@@ -406,8 +409,8 @@ terminal_widget_button_press_event (GtkWidget       *widget,
     {
       /* middle-clicking on an URI fires the responsible application */
       match = vte_terminal_match_check (VTE_TERMINAL (widget),
-                                        event->x / VTE_TERMINAL (widget)->char_width,
-                                        event->y / VTE_TERMINAL (widget)->char_height,
+                                        event->x / vte_terminal_get_char_width(VTE_TERMINAL (widget)),
+                                        event->y / vte_terminal_get_char_height(VTE_TERMINAL (widget)),
                                         &tag);
       if (G_UNLIKELY (match != NULL))
         {
@@ -616,7 +619,7 @@ static gboolean
 terminal_widget_key_press_event (GtkWidget    *widget,
                                  GdkEventKey  *event)
 {
-  GtkAdjustment *adjustment = VTE_TERMINAL (widget)->adjustment;
+  GtkAdjustment *adjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE (widget));
   gboolean       scrolling_single_line;
   gboolean       shortcuts_no_menukey;
   gdouble        value;
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index fc5dca4..02f2f5a 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -183,9 +183,9 @@ static void            terminal_window_action_about                  (GtkAction
 
 
 
-static guint         window_signals[LAST_SIGNAL];
-static gconstpointer window_notebook_group = PACKAGE_NAME;
-static GQuark        tabs_menu_action_quark = 0;
+static guint   window_signals[LAST_SIGNAL];
+static gchar   *window_notebook_group = PACKAGE_NAME;
+static GQuark  tabs_menu_action_quark = 0;
 
 
 
@@ -338,8 +338,7 @@ terminal_window_init (TerminalWindow *window)
   terminal_util_set_style_thinkess (window->notebook, 0);
 
   /* set the notebook group id */
-  gtk_notebook_set_group (GTK_NOTEBOOK (window->notebook),
-                          (gpointer) window_notebook_group);
+  gtk_notebook_set_group_name (GTK_NOTEBOOK (window->notebook), window_notebook_group);
 
   /* signals */
   g_signal_connect (G_OBJECT (window->notebook), "switch-page",
@@ -380,7 +379,7 @@ terminal_window_init (TerminalWindow *window)
 
 #if defined(GDK_WINDOWING_X11)
   /* setup fullscreen mode */
-  if (!gdk_net_wm_supports (gdk_atom_intern ("_NET_WM_STATE_FULLSCREEN", FALSE)))
+  if (!gdk_x11_screen_supports_net_wm_hint (screen, gdk_atom_intern ("_NET_WM_STATE_FULLSCREEN", FALSE)))
     gtk_action_set_sensitive (window->action_fullscreen, FALSE);
 #endif
 }
@@ -1854,7 +1853,8 @@ terminal_window_add (TerminalWindow *window,
   label = terminal_screen_get_tab_label (screen);
 
   page = gtk_notebook_append_page (GTK_NOTEBOOK (window->notebook), GTK_WIDGET (screen), label);
-  gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (window->notebook), GTK_WIDGET (screen), TRUE, TRUE, GTK_PACK_START);
+  // TODO: should not be used anymore according to Gtk docs, remove if sure
+  //gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (window->notebook), GTK_WIDGET (screen), TRUE, TRUE, GTK_PACK_START);
 
   /* allow tab sorting and dnd */
   gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (window->notebook), GTK_WIDGET (screen), TRUE);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list