diff -Nru deepin-terminal-3.0.3+ds/CHANGELOG.md deepin-terminal-3.0.7/CHANGELOG.md --- deepin-terminal-3.0.3+ds/CHANGELOG.md 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/CHANGELOG.md 2018-10-06 18:03:56.000000000 +0000 @@ -1,3 +1,18 @@ +## [3.0.7] - 2018-10-07 +* fix: github issue #74 +* fix: gtk_box_pack assertion error +* refactor: remove 3rdparty/ and vapi/ + +## [3.0.6] - 2018-10-04 +* fix: github issue #73 + +## [3.0.5] - 2018-09-17 +* fix: missing verison info when building the deb + +## [3.0.4] - 2018-09-07 +* fix: unregister menu before recreate menu +* refactor: match more mono fonts + ## [3.0.3] - 2018-08-19 * feat: support customized version string diff -Nru deepin-terminal-3.0.3+ds/cmake/FindVala.cmake deepin-terminal-3.0.7/cmake/FindVala.cmake --- deepin-terminal-3.0.3+ds/cmake/FindVala.cmake 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/cmake/FindVala.cmake 2018-10-06 18:03:56.000000000 +0000 @@ -30,7 +30,7 @@ ## # Find module for the Vala compiler (valac) # -# This module determines wheter a Vala compiler is installed on the current +# This module determines whether a Vala compiler is installed on the current # system and where its executable is. # # Call the module using "find_package(Vala) from within your CMakeLists.txt. diff -Nru deepin-terminal-3.0.3+ds/cmake/ValaVersion.cmake deepin-terminal-3.0.7/cmake/ValaVersion.cmake --- deepin-terminal-3.0.3+ds/cmake/ValaVersion.cmake 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/cmake/ValaVersion.cmake 2018-10-06 18:03:56.000000000 +0000 @@ -35,7 +35,7 @@ # # The initial argument is the version to check for # -# It may be followed by a optional parameter to specifiy a version range. The +# It may be followed by a optional parameter to specify a version range. The # following options are valid: # # EXACT diff -Nru deepin-terminal-3.0.3+ds/CMakeLists.txt deepin-terminal-3.0.7/CMakeLists.txt --- deepin-terminal-3.0.3+ds/CMakeLists.txt 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/CMakeLists.txt 2018-10-06 18:03:56.000000000 +0000 @@ -24,6 +24,7 @@ pkg_check_modules(WNCK REQUIRED libwnck-3.0) pkg_check_modules(FONTCONFIG REQUIRED fontconfig) pkg_check_modules(GLIB REQUIRED glib-2.0) +pkg_check_modules(VTE REQUIRED vte-2.91) OPTION(TEST_BUILD "Build with native testing" ON) @@ -59,22 +60,6 @@ ) endif() -ExternalProject_Add(Vte-0.29 - SOURCE_DIR ${CMAKE_SOURCE_DIR}/3rdparty/vte-0.50.1 - CONFIGURE_COMMAND ./configure --enable-static - BUILD_COMMAND make - INSTALL_COMMAND "" - BUILD_IN_SOURCE 1 - ) - -ExternalProject_Add(zssh-1.5c - SOURCE_DIR ${CMAKE_SOURCE_DIR}/3rdparty/zssh-1.5c - CONFIGURE_COMMAND ./configure - BUILD_COMMAND make - INSTALL_COMMAND "" - BUILD_IN_SOURCE 1 - ) - set(CFLAGS ${GIO_CFLAGS} ${GTK3_CFLAGS} ${GTK3_CFLAGS_OTHER} @@ -94,9 +79,8 @@ ${RSVG_INCLUDE_DIRS} ${JsonGlib_INCLUDE_DIRS} ${LIBSECRET_INCLUDE_DIRS} - ${CMAKE_SOURCE_DIR}/3rdparty/vte-0.50.1/src + ${VTE_INCLUDE_DIRS} ) -find_library(VTE_LIB NAMES libvte-2.91.a tcmalloc_minimal) include_directories(${INCLUDE_PATHS}) set(LIBS ${GIO_LIBRARIES} @@ -111,6 +95,7 @@ ${XTST_LIBRARIES} ${FONTCONFIG_LIBRARY} ${M_LIBRARIES} + ${VTE_LIBRARIES} stdc++ m z @@ -133,9 +118,6 @@ ./main.vala ${APP_SOURCES} -OPTIONS ---vapidir=${CMAKE_SOURCE_DIR}/vapi - PACKAGES xcb gtk+-3.0 @@ -145,15 +127,13 @@ gio-2.0 libwnck-3.0 posix - fontconfig libsecret-1 gdk-x11-3.0 glib-2.0 librsvg-2.0 ) add_executable(${target} ${VALA_C} ${CMAKE_SOURCE_DIR}/project_path.c ${CMAKE_SOURCE_DIR}/lib/font.c) -target_link_libraries(${target} ${LIBS} ${CMAKE_SOURCE_DIR}/3rdparty/vte-0.50.1/src/.libs/libvte-2.91.a) -add_dependencies(${target} Vte-0.29) +target_link_libraries(${target} ${LIBS}) FILE(GLOB children LIST_DIRECTORIES true po/*) SET(dirlist "") @@ -185,7 +165,7 @@ ENDFOREACH(lang) INSTALL (TARGETS ${target} DESTINATION bin) -INSTALL (PROGRAMS ssh_login.sh ${CMAKE_SOURCE_DIR}/3rdparty/zssh-1.5c/zssh DESTINATION lib/${target}) +INSTALL (PROGRAMS ssh_login.sh DESTINATION lib/${target}) INSTALL (FILES hicolor/32x32/${target}.png DESTINATION share/icons/hicolor/32x32/apps) INSTALL (FILES hicolor/48x48/${target}.png DESTINATION share/icons/hicolor/48x48/apps) INSTALL (FILES hicolor/96x96/${target}.png DESTINATION share/icons/hicolor/96x96/apps) diff -Nru deepin-terminal-3.0.3+ds/debian/changelog deepin-terminal-3.0.7/debian/changelog --- deepin-terminal-3.0.3+ds/debian/changelog 2018-08-20 07:23:39.000000000 +0000 +++ deepin-terminal-3.0.7/debian/changelog 2018-10-14 10:38:29.000000000 +0000 @@ -1,3 +1,13 @@ +deepin-terminal (3.0.7-1) unstable; urgency=medium + + * New upstream version 3.0.7 + * Bump Standards-Version to 4.2.1 (no changes needed). + * drop d/patch/0002-use-system-lib, applyed by upstream. + * d/copyright: remove license info of vapi/xcb.vapi. + * d/watch: simplify it by using "dversionmangle=auto". + + -- Yanhao Mo Sun, 14 Oct 2018 18:38:29 +0800 + deepin-terminal (3.0.3+ds-1) unstable; urgency=medium * New upstream version 3.0.3+ds diff -Nru deepin-terminal-3.0.3+ds/debian/control deepin-terminal-3.0.7/debian/control --- deepin-terminal-3.0.3+ds/debian/control 2018-08-20 07:23:39.000000000 +0000 +++ deepin-terminal-3.0.7/debian/control 2018-10-14 10:38:29.000000000 +0000 @@ -31,7 +31,7 @@ libwnck-3-dev, libxml2-utils, valac, -Standards-Version: 4.2.0 +Standards-Version: 4.2.1 Homepage: https://github.com/linuxdeepin/deepin-terminal Vcs-Git: https://salsa.debian.org/pkg-deepin-team/deepin-terminal.git Vcs-Browser: https://salsa.debian.org/pkg-deepin-team/deepin-terminal diff -Nru deepin-terminal-3.0.3+ds/debian/copyright deepin-terminal-3.0.7/debian/copyright --- deepin-terminal-3.0.3+ds/debian/copyright 2018-08-20 07:16:16.000000000 +0000 +++ deepin-terminal-3.0.7/debian/copyright 2018-10-14 10:38:29.000000000 +0000 @@ -42,11 +42,6 @@ Copyright: 2011-2012 Canonical Ltd License: GPL-3 -Files: vapi/xcb.vapi -Copyright: 2009 Jürg Billeter - 2013 Sergio Costas -License: LGPL-2.1+ - Files: debian/* Copyright: 2016 Deepin Packages Builder 2018 Yangfl @@ -103,23 +98,6 @@ On Debian systems, the complete text of the GNU General Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". -License: LGPL-2.1+ - This program is free software: you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - . - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU Lesser General - Public License can be found in "/usr/share/common-licenses/LGPL-2". - License: BSD-2-Clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff -Nru deepin-terminal-3.0.3+ds/debian/patches/0002-use-system-libs.patch deepin-terminal-3.0.7/debian/patches/0002-use-system-libs.patch --- deepin-terminal-3.0.3+ds/debian/patches/0002-use-system-libs.patch 2018-08-20 07:16:16.000000000 +0000 +++ deepin-terminal-3.0.7/debian/patches/0002-use-system-libs.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -From: Yanhao Mo -Date: Wed, 16 May 2018 13:16:20 +0800 -Subject: use system libs - ---- - CMakeLists.txt | 25 +++++-------------------- - 1 file changed, 5 insertions(+), 20 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9d57aca..47f83d7 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -24,6 +24,7 @@ pkg_check_modules(RSVG REQUIRED librsvg-2.0) - pkg_check_modules(WNCK REQUIRED libwnck-3.0) - pkg_check_modules(FONTCONFIG REQUIRED fontconfig) - pkg_check_modules(GLIB REQUIRED glib-2.0) -+pkg_check_modules(VTE REQUIRED vte-2.91) - - OPTION(TEST_BUILD "Build with native testing" ON) - -@@ -44,22 +45,6 @@ execute_process( - ) - endif() - --ExternalProject_Add(Vte-0.29 -- SOURCE_DIR ${CMAKE_SOURCE_DIR}/3rdparty/vte-0.50.1 -- CONFIGURE_COMMAND ./configure --enable-static -- BUILD_COMMAND make -- INSTALL_COMMAND "" -- BUILD_IN_SOURCE 1 -- ) -- --ExternalProject_Add(zssh-1.5c -- SOURCE_DIR ${CMAKE_SOURCE_DIR}/3rdparty/zssh-1.5c -- CONFIGURE_COMMAND ./configure -- BUILD_COMMAND make -- INSTALL_COMMAND "" -- BUILD_IN_SOURCE 1 -- ) -- - set(CFLAGS - ${GIO_CFLAGS} - ${GTK3_CFLAGS} ${GTK3_CFLAGS_OTHER} -@@ -79,7 +64,7 @@ set(INCLUDE_PATHS - ${RSVG_INCLUDE_DIRS} - ${JsonGlib_INCLUDE_DIRS} - ${LIBSECRET_INCLUDE_DIRS} -- ${CMAKE_SOURCE_DIR}/3rdparty/vte-0.50.1/src -+ ${VTE_INCLUDE_DIRS} - ) - find_library(VTE_LIB NAMES libvte-2.91.a tcmalloc_minimal) - include_directories(${INCLUDE_PATHS}) -@@ -96,6 +81,7 @@ set(LIBS - ${XTST_LIBRARIES} - ${FONTCONFIG_LIBRARY} - ${M_LIBRARIES} -+ ${VTE_LIBRARIES} - stdc++ - m - z -@@ -137,8 +123,7 @@ PACKAGES - librsvg-2.0 - ) - add_executable(${target} ${VALA_C} ${CMAKE_SOURCE_DIR}/project_path.c ${CMAKE_SOURCE_DIR}/lib/font.c) --target_link_libraries(${target} ${LIBS} ${CMAKE_SOURCE_DIR}/3rdparty/vte-0.50.1/src/.libs/libvte-2.91.a) --add_dependencies(${target} Vte-0.29) -+target_link_libraries(${target} ${LIBS}) - - FILE(GLOB children LIST_DIRECTORIES true po/*) - SET(dirlist "") -@@ -170,7 +155,7 @@ FOREACH(lang ${dirlist}) - ENDFOREACH(lang) - - INSTALL (TARGETS ${target} DESTINATION bin) --INSTALL (PROGRAMS ssh_login.sh ${CMAKE_SOURCE_DIR}/3rdparty/zssh-1.5c/zssh DESTINATION lib/${target}) -+INSTALL (PROGRAMS ssh_login.sh DESTINATION lib/${target}) - INSTALL (FILES hicolor/32x32/${target}.png DESTINATION share/icons/hicolor/32x32/apps) - INSTALL (FILES hicolor/48x48/${target}.png DESTINATION share/icons/hicolor/48x48/apps) - INSTALL (FILES hicolor/96x96/${target}.png DESTINATION share/icons/hicolor/96x96/apps) diff -Nru deepin-terminal-3.0.3+ds/debian/patches/series deepin-terminal-3.0.7/debian/patches/series --- deepin-terminal-3.0.3+ds/debian/patches/series 2018-08-20 07:16:16.000000000 +0000 +++ deepin-terminal-3.0.7/debian/patches/series 2018-10-14 10:38:29.000000000 +0000 @@ -1,2 +1 @@ 0001-use-system-zssh.patch -0002-use-system-libs.patch diff -Nru deepin-terminal-3.0.3+ds/debian/watch deepin-terminal-3.0.7/debian/watch --- deepin-terminal-3.0.3+ds/debian/watch 2018-08-20 07:16:16.000000000 +0000 +++ deepin-terminal-3.0.7/debian/watch 2018-10-14 10:38:29.000000000 +0000 @@ -1,5 +1,5 @@ version=4 -opts="dversionmangle=s/\+(debian|dfsg|ds|deb)(\.\d+)?$//,repacksuffix=+ds, \ +opts="dversionmangle=auto, repacksuffix=+ds, \ filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%deepin-terminal-$1.tar.gz%" \ https://github.com/linuxdeepin/deepin-terminal/tags \ (?:.*?/)?(\d[\d.]*)\.tar\.gz debian uupdate diff -Nru deepin-terminal-3.0.3+ds/lib/animation.vala deepin-terminal-3.0.7/lib/animation.vala --- deepin-terminal-3.0.3+ds/lib/animation.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/lib/animation.vala 2018-10-06 18:03:56.000000000 +0000 @@ -22,10 +22,10 @@ public class AnimateTimer : Object { public bool is_running { get { return timeout != 0; } } public double progress { get; private set; } - + /* speed is in milliseconds */ public int speed { get; set; } - + public unowned EasingFunc easing_func { get; private set; } /* progress is from 0.0 to 1.0 */ @@ -45,10 +45,10 @@ ease_out_quint. */ /* speed is in milliseconds */ - + /* x and y are 0.0 to 1.0 */ public delegate double EasingFunc (double x); - + private TimeSpan extra_time = 0; private TimeSpan length = 0; private TimeSpan start_time = 0; @@ -124,7 +124,7 @@ public static double ease_in_quad (double x) { return Math.pow (x, 2); } - + public static double ease_out_quad (double x) { return -1 * Math.pow (x - 1, 2) + 1; } @@ -132,7 +132,7 @@ public static double ease_in_quint (double x) { return Math.pow (x, 5); } - + public static double ease_out_quint (double x) { return Math.pow (x - 1, 5) + 1; } diff -Nru deepin-terminal-3.0.3+ds/lib/config.vala deepin-terminal-3.0.7/lib/config.vala --- deepin-terminal-3.0.3+ds/lib/config.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/lib/config.vala 2018-10-06 18:03:56.000000000 +0000 @@ -396,16 +396,16 @@ update_theme(theme_name); temp_theme = theme_name; } - + public void set_theme(string theme_name) { // Set temp theme with null to override. temp_theme = null; - + update_theme(theme_name); save(); update(); } - + public void update_theme(string theme_name) { try { KeyFile theme_file = new KeyFile(); @@ -431,13 +431,13 @@ public void save() { try { Utils.touch_dir(Utils.get_config_dir()); - + // Restore config file theme if temp_theme is not null. if (temp_theme != null) { try { var theme_file = new KeyFile(); theme_file.load_from_file(config_file_path, KeyFileFlags.NONE); - + var theme_name = theme_file.get_string("general", "theme").strip(); update_theme(theme_name); } catch (KeyFileError e) { @@ -470,4 +470,4 @@ } } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/lib/constant.vala.in deepin-terminal-3.0.7/lib/constant.vala.in --- deepin-terminal-3.0.3+ds/lib/constant.vala.in 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/lib/constant.vala.in 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ public class Constant { public static double TERMINAL_MIN_OPACITY = 0; @@ -45,7 +45,7 @@ public static int REMOTE_PANEL_SEARCHBAR_HEIGHT = 36; public static int RESPONSE_RADIUS = 10; public static int SEARCH_PANEL_WIDTH = 322; - public static int SLIDER_PANEL_TEXT_WIDTH = 150; + public static int SLIDER_PANEL_TEXT_WIDTH = 150; public static int SLIDER_WIDTH = 280; public static int THEME_BUTTON_HEIGHT = 54; public static int THEME_BUTTON_PADDING = 5; @@ -55,4 +55,4 @@ public static int WINDOW_BUTTON_WIDHT = 27; public static int EXIT_CODE_BAD_SMABA = 139; public static int EXIT_CODE_NORMAL = 0; -} +} diff -Nru deepin-terminal-3.0.3+ds/lib/draw.vala deepin-terminal-3.0.7/lib/draw.vala --- deepin-terminal-3.0.3+ds/lib/draw.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/lib/draw.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,14 +19,14 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Cairo; namespace Draw { public void draw_surface(Cairo.Context cr, ImageSurface surface, int x = 0, int y = 0, int width=0, int height=0) { if (surface != null) { - cr.set_source_surface(surface, x + int.max(0, (int)(width - surface.get_width() / Utils.get_default_monitor_scale()) / 2), + cr.set_source_surface(surface, x + int.max(0, (int)(width - surface.get_width() / Utils.get_default_monitor_scale()) / 2), y + int.max(0, (int)(height - surface.get_height() / Utils.get_default_monitor_scale()) / 2)); cr.paint_with_alpha(1.0); } @@ -37,10 +37,10 @@ string vertical_align = "middle", int? wrap_width=null) { cr.save(); - + var font_description = new Pango.FontDescription(); font_description.set_size((int)(size * Pango.SCALE)); - + var layout = Pango.cairo_create_layout(cr); layout.set_font_description(font_description); layout.set_markup(text, text.length); @@ -65,11 +65,11 @@ } else { render_y = y + int.max(0, height - text_height); } - + cr.move_to(x, render_y); Pango.cairo_update_layout(cr, layout); Pango.cairo_show_layout(cr, layout); - + cr.restore(); } @@ -85,7 +85,7 @@ int? wrap_width=null) { var font_description = new Pango.FontDescription(); font_description.set_size((int)(size * Pango.SCALE)); - + var layout = widget.create_pango_layout(null); layout.set_font_description(font_description); layout.set_text(text, text.length); @@ -114,55 +114,55 @@ } } - public void fill_rounded_rectangle(Context cr, int x, int y, int width, int height, double r) { + public void fill_rounded_rectangle(Context cr, int x, int y, int width, int height, double r) { cr.new_sub_path(); cr.arc(x + width - r, y + r, r, Math.PI * 3 / 2, Math.PI * 2); cr.arc(x + width - r, y + height - r, r, 0, Math.PI / 2); cr.arc(x + r, y + height - r, r, Math.PI / 2, Math.PI); cr.arc(x + r, y + r, r, Math.PI, Math.PI * 3 / 2); cr.close_path(); - + cr.fill(); - } + } public void stroke_rounded_rectangle(Context cr, int x, int y, int width, int height, double r, Gdk.RGBA frame_color, Gdk.RGBA background_color, int line_width=1) { cr.set_source_rgba(frame_color.red, frame_color.green, frame_color.blue, frame_color.alpha); Draw.fill_rounded_rectangle(cr, x, y, width, height, r); cr.set_source_rgba(background_color.red, background_color.green, background_color.blue, background_color.alpha); Draw.fill_rounded_rectangle(cr, x + line_width, y + line_width, width - line_width * 2, height - line_width * 2, r); - } + } - public void draw_search_rectangle(Context cr, int x, int y, int width, int height, double r, bool fill=true) { + public void draw_search_rectangle(Context cr, int x, int y, int width, int height, double r, bool fill=true) { // Top side. cr.move_to(x, y); cr.line_to(x + width, y); - + // Right side. cr.line_to(x + width, y + height); - + // Bottom side. cr.line_to(x + r, y + height); - + // Bottom-left corner. cr.arc(x + r, y + height - r, r, Math.PI / 2, Math.PI); - + // Left side. cr.line_to(x, y); - + // Close path. cr.close_path(); - - if (fill) { - cr.fill(); - } else { - cr.stroke(); - } - } - public void draw_radial(Cairo.Context cr, int x, int width, int height, Gdk.RGBA center_color, Gdk.RGBA edge_color) { + if (fill) { + cr.fill(); + } else { + cr.stroke(); + } + } + + public void draw_radial(Cairo.Context cr, int x, int width, int height, Gdk.RGBA center_color, Gdk.RGBA edge_color) { Cairo.Pattern pattern = new Cairo.Pattern.radial(x + width / 2, height, width / 2, x + width / 2, height, 0); pattern.add_color_stop_rgba(1, center_color.red, center_color.green, center_color.blue, center_color.alpha); - pattern.add_color_stop_rgba(0, edge_color.red, edge_color.green, edge_color.blue, edge_color.alpha); + pattern.add_color_stop_rgba(0, edge_color.red, edge_color.green, edge_color.blue, edge_color.alpha); cr.set_source(pattern); cr.paint(); } @@ -171,15 +171,15 @@ cr.rectangle(x, y, w, h); cr.clip(); } - - public void clip_rounded_rectangle(Context cr, int x, int y, int width, int height, double r) { + + public void clip_rounded_rectangle(Context cr, int x, int y, int width, int height, double r) { cr.new_sub_path(); cr.arc(x + width - r, y + r, r, Math.PI * 3 / 2, Math.PI * 2); cr.arc(x + width - r, y + height - r, r, 0, Math.PI / 2); cr.arc(x + r, y + height - r, r, Math.PI / 2, Math.PI); cr.arc(x + r, y + r, r, Math.PI, Math.PI * 3 / 2); cr.close_path(); - + cr.clip(); - } -} \ No newline at end of file + } +} diff -Nru deepin-terminal-3.0.3+ds/lib/font.c deepin-terminal-3.0.7/lib/font.c --- deepin-terminal-3.0.3+ds/lib/font.c 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/lib/font.c 2018-10-06 18:03:56.000000000 +0000 @@ -19,18 +19,29 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ #include #include #include #include #include +#include #include +static int string_rematch(const char* string,const char* pattern) { + int ret = 0; + regex_t regex; + regcomp(®ex, pattern, REG_ICASE); + if (regexec(®ex, string, 0, NULL, 0) == REG_NOERROR) + ret = 1; + regfree(®ex); + return ret; +} + gchar** list_mono_or_dot_fonts(gint* num, int* result_length) { FcInit(); - + FcPattern *pat = FcPatternCreate(); if (!pat) { fprintf(stderr, "Create FcPattern Failed\n"); @@ -46,7 +57,7 @@ FC_FILE, FC_LANG, FC_SPACING, - FC_CHARSET, + FC_CHARSET, NULL); if (!os) { fprintf(stderr, "Build FcObjectSet Failed\n"); @@ -62,11 +73,11 @@ return NULL; } - /* Read family name of mono font. */ - gchar** fonts = NULL; - int j; - int count = 0; - for (j = 0; j < fs->nfont; j++) { + /* Read family name of mono font. */ + gchar** fonts = NULL; + int j; + int count = 0; + for (j = 0; j < fs->nfont; j++) { /* printf("family: %s\n familylang: %s\n fullname: %s\n fullnamelang: %s\n style: %s\n file: %s\n lang: %s\n spacing: %s\n charset: %s\n", */ /* FcPatternFormat(fs->fonts[j], (FcChar8*)"%{family}"), */ /* FcPatternFormat(fs->fonts[j], (FcChar8*)"%{familylang}"), */ @@ -79,76 +90,72 @@ /* FcPatternFormat(fs->fonts[j], (FcChar8*)"%{charset}") */ /* ); */ - char *font_family = (char*) FcPatternFormat(fs->fonts[j], (FcChar8*)"%{family}"); - char *comma = NULL; + char *font_family = (char*) FcPatternFormat(fs->fonts[j], (FcChar8*)"%{family}"); + char *comma = NULL; - // split with ',' and using last one - while ((comma = strchr(font_family, ',')) != NULL) - font_family = comma + 1; + // split with ',' and using last one + while ((comma = strchr(font_family, ',')) != NULL) + font_family = comma + 1; /* spacing 100 is mono font, spacing 110 is dot font */ - if (strcmp((char*) FcPatternFormat(fs->fonts[j], (FcChar8*)"%{spacing}"), "100") == 0 + if (strcmp((char*) FcPatternFormat(fs->fonts[j], (FcChar8*)"%{spacing}"), "100") == 0 || strcmp((char*) FcPatternFormat(fs->fonts[j], (FcChar8*)"%{spacing}"), "110") == 0 - || strcmp(font_family, "WenQuanYi Micro Hei Mono") == 0 - || strcmp(font_family, "WenQuanYi Zen Hei Mono") == 0 + || string_rematch(font_family, "mono") || strcmp(font_family, "YaHei Consolas Hybrid") == 0 - || strcmp(font_family, "mononoki") == 0 - || strcmp(font_family, "Roboto Mono") == 0 - || strcmp(font_family, "Oxygen Mono") == 0 || strcmp(font_family, "Monaco") == 0 ) { - /* Realloc was realloc(fonts, 0), and you have to take space for */ - fonts = realloc(fonts, (count + 1) * sizeof(gchar*)); - if (fonts == NULL) { - fprintf(stderr, "Alloc memory at append %d font info failed\n", count + 1); - return NULL; - } - - /* Filter charset font */ - char *charset = (char*)FcPatternFormat(fs->fonts[j], (FcChar8*)"%{charset}"); - if (charset == NULL || strlen(charset) == 0) { - free(charset); - continue; - } - free(charset); - - /* Got font name */ - gchar* font = g_strdup(font_family); - - /* Need space for store font */ - fonts[count] = malloc((strlen(font) + 1) * sizeof(gchar)); - if (fonts[count] == NULL) { - fprintf(stderr, "Malloc %d failed\n", count + 1); - return NULL; - } - - strcpy(fonts[count], font); - - free(font); - - count++; - } - } - - /* Remove duplicate font family. */ - int i, k; - for (i = 0; i < count; i++) { + /* Realloc was realloc(fonts, 0), and you have to take space for */ + fonts = realloc(fonts, (count + 1) * sizeof(gchar*)); + if (fonts == NULL) { + fprintf(stderr, "Alloc memory at append %d font info failed\n", count + 1); + return NULL; + } + + /* Filter charset font */ + char *charset = (char*)FcPatternFormat(fs->fonts[j], (FcChar8*)"%{charset}"); + if (charset == NULL || strlen(charset) == 0) { + free(charset); + continue; + } + free(charset); + + /* Got font name */ + gchar* font = g_strdup(font_family); + + /* Need space for store font */ + fonts[count] = malloc((strlen(font) + 1) * sizeof(gchar)); + if (fonts[count] == NULL) { + fprintf(stderr, "Malloc %d failed\n", count + 1); + return NULL; + } + + strcpy(fonts[count], font); + + free(font); + + count++; + } + } + + /* Remove duplicate font family. */ + int i, k; + for (i = 0; i < count; i++) { for (j = i + 1; j < count;) { - if (strcmp(fonts[j], fonts[i]) == 0) { + if (strcmp(fonts[j], fonts[i]) == 0) { for (k = j; k < count; k++) { fonts[k] = fonts[k + 1]; - } - count--; - } else - j++; - } - } - *num = count; - *result_length = count; - - FcFontSetDestroy(fs); - - return fonts; + } + count--; + } else + j++; + } + } + *num = count; + *result_length = count; + + FcFontSetDestroy(fs); + + return fonts; } gchar* font_match(gchar* family) { @@ -180,7 +187,7 @@ FcPatternDestroy(font); FcFontSetDestroy(fs); FcPatternDestroy(match); - + if (!ret) { return NULL; } @@ -188,16 +195,16 @@ return (gchar*)ret; } -/* void main(int argc, char *argv[]) { */ -/* int font_num = 0; */ -/* char** fonts = list_mono_or_dot_fonts(&font_num); */ - -/* int i; */ -/* for (i = 0; i < font_num; i++) { */ -/* printf("%s\n", fonts[i]); */ -/* } */ - -/* printf("\n"); */ -/* printf("%s", font_match("mono")); */ -/* } */ - +/* void main(int argc, char *argv[]) { + gint num = 0; + int font_num = 0; + gchar** fonts = list_mono_or_dot_fonts(&num, &font_num); + + int i; + for (i = 0; i < font_num; i++) { + printf("%s\n", fonts[i]); + } + + printf("\n"); + printf("%s", font_match("Mono")); +} */ diff -Nru deepin-terminal-3.0.3+ds/lib/keymap.vala deepin-terminal-3.0.7/lib/keymap.vala --- deepin-terminal-3.0.3+ds/lib/keymap.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/lib/keymap.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using GLib; @@ -30,7 +30,7 @@ } else { var key_modifiers = get_key_event_modifiers(key_event); var key_name = get_key_name(key_event.keyval); - + if (key_modifiers.length == 0) { return key_name; } else { @@ -39,7 +39,7 @@ name += modifier + " + "; } name += key_name; - + return name; } } @@ -63,22 +63,22 @@ if ((key_event.state & Gdk.ModifierType.MOD1_MASK) != 0) { modifiers += "Alt"; } - + if ((key_event.state & Gdk.ModifierType.SHIFT_MASK) != 0) { modifiers += "Shift"; } - + return modifiers; } public string get_key_name(uint keyval) { unichar key_unicode = Gdk.keyval_to_unicode(Gdk.keyval_to_lower(keyval)); - + if (key_unicode == 0) { // function keys at top line of keyboard var keyname = Gdk.keyval_name(keyval); - + // Gdk.keyval_name will return null when user's hardware got KEY_UNKNOWN from hardware. - // So, we need return emptry string to protect program won't crash later. + // So, we need return empty string to protect program won't crash later. if (keyname == null) { return ""; } @@ -96,8 +96,8 @@ } else if (key_unicode == 27) { return "Esc"; } else if (key_unicode == 8) { - return "Backspace"; - } else if (key_unicode == 127) { + return "Backspace"; + } else if (key_unicode == 127) { return "Delete"; } else if (key_unicode == 32) { return "Space"; @@ -109,7 +109,7 @@ public bool has_ctrl_mask(Gdk.EventKey key_event) { string[] mask_list = {"Control_L", "Control_R"}; - + return get_key_name(key_event.keyval) in mask_list; } @@ -118,8 +118,8 @@ return get_key_name(key_event.keyval) in mask_list; } - public bool is_no_key_press(Gdk.EventKey key_event) { - return (key_event.is_modifier == 0 && get_key_name(key_event.keyval) == get_keyevent_name(key_event) || - key_event.is_modifier != 0 && get_key_event_modifiers(key_event).length == 1); - } -} \ No newline at end of file + public bool is_no_key_press(Gdk.EventKey key_event) { + return (key_event.is_modifier == 0 && get_key_name(key_event.keyval) == get_keyevent_name(key_event) || + key_event.is_modifier != 0 && get_key_event_modifiers(key_event).length == 1); + } +} diff -Nru deepin-terminal-3.0.3+ds/lib/menu.vala deepin-terminal-3.0.7/lib/menu.vala --- deepin-terminal-3.0.3+ds/lib/menu.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/lib/menu.vala 2018-10-06 18:03:56.000000000 +0000 @@ -25,174 +25,190 @@ [DBus (name = "com.deepin.menu.Manager")] interface MenuManagerInterface : Object { public abstract string RegisterMenu() throws IOError; + public abstract void UnregisterMenu(string object_path) throws IOError; } [DBus (name = "com.deepin.menu.Menu")] interface MenuInterface : Object { public abstract void ShowMenu(string menu_json_content) throws IOError; - public signal void ItemInvoked(string item_id, bool checked); - public signal void MenuUnregistered(); - } - - public class MenuItem : Object { - public string menu_item_id; - public string menu_item_text; - public List menu_item_submenu; + public signal void ItemInvoked(string item_id, bool checked); + public signal void MenuUnregistered(); + } - public MenuItem(string item_id, string item_text) { - menu_item_id = item_id; - menu_item_text = item_text; + public class MenuItem : Object { + public string menu_item_id; + public string menu_item_text; + public List menu_item_submenu; + + public MenuItem(string item_id, string item_text) { + menu_item_id = item_id; + menu_item_text = item_text; + + menu_item_submenu = new List(); + } + + public void add_submenu_item(MenuItem item) { + menu_item_submenu.append(item); + } + } - menu_item_submenu = new List(); - } + public class Menu : Object { + MenuManagerInterface menu_manager_interface; + MenuInterface menu_interface; + static string? menu_object_path; - public void add_submenu_item(MenuItem item) { - menu_item_submenu.append(item); - } - } + public signal void click_item(string item_id); + public signal void destroy(); - public class Menu : Object { - MenuInterface menu_interface; + public Menu(int menu_x, int menu_y, List menu_content) { + try { + menu_manager_interface = Bus.get_proxy_sync(BusType.SESSION, "com.deepin.menu", "/com/deepin/menu"); - public signal void click_item(string item_id); - public signal void destroy(); + if (menu_object_path != null) + unregister(); + menu_object_path = menu_manager_interface.RegisterMenu(); - public Menu(int menu_x, int menu_y, List menu_content) { - try { - MenuManagerInterface menu_manager_interface = Bus.get_proxy_sync(BusType.SESSION, "com.deepin.menu", "/com/deepin/menu"); - string menu_object_path = menu_manager_interface.RegisterMenu(); + menu_interface = Bus.get_proxy_sync(BusType.SESSION, "com.deepin.menu", menu_object_path); + menu_interface.ItemInvoked.connect((item_id, checked) => { + click_item(item_id); + }); + menu_interface.MenuUnregistered.connect(() => { + menu_object_path = null; + destroy(); + }); + } catch (IOError e) { + stderr.printf ("%s\n", e.message); + } - menu_interface = Bus.get_proxy_sync(BusType.SESSION, "com.deepin.menu", menu_object_path); - menu_interface.ItemInvoked.connect((item_id, checked) => { - click_item(item_id); - }); - menu_interface.MenuUnregistered.connect(() => { - destroy(); - }); - } catch (IOError e) { - stderr.printf ("%s\n", e.message); - } + show_menu(menu_x, menu_y, menu_content); + } - show_menu(menu_x, menu_y, menu_content); - } + public void unregister(){ + try { + menu_manager_interface.UnregisterMenu(menu_object_path); + } catch (IOError e) { + stderr.printf ("%s\n", e.message); + } + menu_object_path = null; + } - public void show_menu(int x, int y, List menu_content) { - // since GTK only supports integral scaling yet DDE supports fractional scaling, - // the scale on both sides may not be the same, so we need to negtiate here. - var scale = Utils.get_default_monitor_scale(); - var dde_scale = Utils.get_dde_scale_ratio(); + public void show_menu(int x, int y, List menu_content) { + // since GTK only supports integral scaling yet DDE supports fractional scaling, + // the scale on both sides may not be the same, so we need to negtiate here. + var scale = Utils.get_default_monitor_scale(); + var dde_scale = Utils.get_dde_scale_ratio(); - if (scale != dde_scale) { - x = (int)(x * scale / dde_scale); - y = (int)(y * scale / dde_scale); - } + if (scale != dde_scale) { + x = (int)(x * scale / dde_scale); + y = (int)(y * scale / dde_scale); + } - try { - Json.Builder builder = new Json.Builder(); + try { + Json.Builder builder = new Json.Builder(); - builder.begin_object(); + builder.begin_object(); - builder.set_member_name("x"); - builder.add_int_value(x); + builder.set_member_name("x"); + builder.add_int_value(x); - builder.set_member_name("y"); - builder.add_int_value(y); + builder.set_member_name("y"); + builder.add_int_value(y); - builder.set_member_name("isDockMenu"); - builder.add_boolean_value(false); + builder.set_member_name("isDockMenu"); + builder.add_boolean_value(false); - builder.set_member_name("menuJsonContent"); - builder.add_string_value(get_items_node(menu_content)); + builder.set_member_name("menuJsonContent"); + builder.add_string_value(get_items_node(menu_content)); - builder.end_object (); + builder.end_object (); - Json.Generator generator = new Json.Generator(); - Json.Node root = builder.get_root(); - generator.set_root(root); + Json.Generator generator = new Json.Generator(); + Json.Node root = builder.get_root(); + generator.set_root(root); - string menu_json_content = generator.to_data(null); + string menu_json_content = generator.to_data(null); - menu_interface.ShowMenu(menu_json_content); - } catch (IOError e) { - stderr.printf ("%s\n", e.message); - } - } + menu_interface.ShowMenu(menu_json_content); + } catch (IOError e) { + stderr.printf ("%s\n", e.message); + } + } - public string get_items_node(List menu_content) { - Json.Builder builder = new Json.Builder(); + public string get_items_node(List menu_content) { + Json.Builder builder = new Json.Builder(); - builder.begin_object(); + builder.begin_object(); - builder.set_member_name("items"); - builder.begin_array (); - foreach (MenuItem item in menu_content) { - builder.add_value(get_item_node(item)); - } - builder.end_array (); + builder.set_member_name("items"); + builder.begin_array (); + foreach (MenuItem item in menu_content) { + builder.add_value(get_item_node(item)); + } + builder.end_array (); - builder.end_object (); + builder.end_object (); - Json.Generator generator = new Json.Generator(); - generator.set_root(builder.get_root()); + Json.Generator generator = new Json.Generator(); + generator.set_root(builder.get_root()); - return generator.to_data(null); - } + return generator.to_data(null); + } - public Json.Node get_item_node(MenuItem item) { - Json.Builder builder = new Json.Builder(); + public Json.Node get_item_node(MenuItem item) { + Json.Builder builder = new Json.Builder(); - builder.begin_object(); + builder.begin_object(); - builder.set_member_name("itemId"); - builder.add_string_value(item.menu_item_id); + builder.set_member_name("itemId"); + builder.add_string_value(item.menu_item_id); - builder.set_member_name("itemText"); - builder.add_string_value(item.menu_item_text); + builder.set_member_name("itemText"); + builder.add_string_value(item.menu_item_text); - builder.set_member_name("itemIcon"); - builder.add_string_value(""); + builder.set_member_name("itemIcon"); + builder.add_string_value(""); - builder.set_member_name("itemIconHover"); - builder.add_string_value(""); + builder.set_member_name("itemIconHover"); + builder.add_string_value(""); - builder.set_member_name("itemIconInactive"); - builder.add_string_value(""); + builder.set_member_name("itemIconInactive"); + builder.add_string_value(""); - builder.set_member_name("itemExtra"); - builder.add_string_value(""); + builder.set_member_name("itemExtra"); + builder.add_string_value(""); - builder.set_member_name("isActive"); - builder.add_boolean_value(true); + builder.set_member_name("isActive"); + builder.add_boolean_value(true); - builder.set_member_name("checked"); - builder.add_boolean_value(false); + builder.set_member_name("checked"); + builder.add_boolean_value(false); - builder.set_member_name("itemSubMenu"); - unowned List submenu_items = item.menu_item_submenu; + builder.set_member_name("itemSubMenu"); + unowned List submenu_items = item.menu_item_submenu; - if (submenu_items.length() == 0) { - builder.add_null_value(); - } else { - Json.Builder _builder = new Json.Builder(); + if (submenu_items.length() == 0) { + builder.add_null_value(); + } else { + Json.Builder _builder = new Json.Builder(); - _builder.begin_object (); + _builder.begin_object (); - _builder.set_member_name("items"); + _builder.set_member_name("items"); - _builder.begin_array (); - foreach (MenuItem _item in submenu_items) { - _builder.add_value(get_item_node(_item)); - } - _builder.end_array (); + _builder.begin_array (); + foreach (MenuItem _item in submenu_items) { + _builder.add_value(get_item_node(_item)); + } + _builder.end_array (); - _builder.end_object (); + _builder.end_object (); - builder.add_value(_builder.get_root()); - } + builder.add_value(_builder.get_root()); + } - builder.end_object (); + builder.end_object (); - return builder.get_root(); - } - } -} \ No newline at end of file + return builder.get_root(); + } + } +} diff -Nru deepin-terminal-3.0.3+ds/lib/utils.vala deepin-terminal-3.0.7/lib/utils.vala --- deepin-terminal-3.0.3+ds/lib/utils.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/lib/utils.vala 2018-10-06 18:03:56.000000000 +0000 @@ -36,7 +36,7 @@ interface DeepinManualInterface : Object { public abstract void ShowManual(string appName) throws IOError; } - + public Gdk.RGBA hex_to_rgba(string hex_color, double alpha=1.0) { Gdk.RGBA rgba_color = Gdk.RGBA(); rgba_color.parse(hex_color); @@ -319,7 +319,7 @@ #else return GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, (string) project_path(), "lib", "deepin-terminal", "ssh_login.sh"); #endif - } + } public string get_default_private_key_path() { return GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, Environment.get_home_dir(), ".ssh", "id_rsa"); @@ -411,12 +411,12 @@ } public void show_manual() { - try { - DeepinManualInterface deepin_manual_interface = Bus.get_proxy_sync(BusType.SESSION, "com.deepin.Manual.Open", "/com/deepin/Manual/Open"); - deepin_manual_interface.ShowManual("deepin-terminal"); - } catch (GLib.IOError e) { - print("show_manual: %s\n", e.message); - } + try { + DeepinManualInterface deepin_manual_interface = Bus.get_proxy_sync(BusType.SESSION, "com.deepin.Manual.Open", "/com/deepin/Manual/Open"); + deepin_manual_interface.ShowManual("deepin-terminal"); + } catch (GLib.IOError e) { + print("show_manual: %s\n", e.message); + } } public void write_log(string log) { @@ -431,23 +431,23 @@ } public Cairo.ImageSurface create_image_surface(string surface_path) { - try { - var scale = get_default_monitor_scale(); - Rsvg.Handle r = new Rsvg.Handle.from_file(Utils.get_image_path(surface_path)); - Rsvg.DimensionData d = r.get_dimensions(); - Cairo.ImageSurface cs = new Cairo.ImageSurface(Cairo.Format.ARGB32, (int)(d.width * scale), (int)(d.height * scale)); - cs.set_device_scale(scale, scale); - Cairo.Context c = new Cairo.Context(cs); - r.render_cairo(c); - - return cs; - } catch (GLib.Error e) { - print("create_image_surface: %s %s\n", surface_path, e.message); - - Cairo.ImageSurface cs = new Cairo.ImageSurface(Cairo.Format.ARGB32, 1, 1); - return cs; - } - } + try { + var scale = get_default_monitor_scale(); + Rsvg.Handle r = new Rsvg.Handle.from_file(Utils.get_image_path(surface_path)); + Rsvg.DimensionData d = r.get_dimensions(); + Cairo.ImageSurface cs = new Cairo.ImageSurface(Cairo.Format.ARGB32, (int)(d.width * scale), (int)(d.height * scale)); + cs.set_device_scale(scale, scale); + Cairo.Context c = new Cairo.Context(cs); + r.render_cairo(c); + + return cs; + } catch (GLib.Error e) { + print("create_image_surface: %s %s\n", surface_path, e.message); + + Cairo.ImageSurface cs = new Cairo.ImageSurface(Cairo.Format.ARGB32, 1, 1); + return cs; + } + } public int get_active_monitor(Gdk.Screen screen) { var window = screen.get_active_window(); diff -Nru deepin-terminal-3.0.3+ds/lib/xutils.vala deepin-terminal-3.0.7/lib/xutils.vala --- deepin-terminal-3.0.3+ds/lib/xutils.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/lib/xutils.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ namespace XUtils { public static int _NET_WM_MOVERESIZE_MOVE = 8; @@ -88,9 +88,9 @@ public void send_message(int xid, long x, long y, int action, int button, int secret_value) { weak X.Display display = Gdk.X11.get_default_xdisplay(); weak X.Window xrootwindow = display.root_window(0); - + X.Event event = X.Event(); - + event.xclient.type = X.EventType.ClientMessage; event.xclient.message_type = Gdk.X11.get_xatom_by_name("_NET_WM_MOVERESIZE"); event.xclient.display = display; @@ -101,13 +101,13 @@ event.xclient.data.l[2] = action; event.xclient.data.l[3] = button; event.xclient.data.l[4] = secret_value; - + display.send_event( xrootwindow, false, X.EventMask.SubstructureNotifyMask | X.EventMask.SubstructureRedirectMask, ref event); - + display.flush(); } } diff -Nru deepin-terminal-3.0.3+ds/main.vala deepin-terminal-3.0.7/main.vala --- deepin-terminal-3.0.3+ds/main.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/main.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gdk; using Gee; @@ -37,12 +37,12 @@ stderr.printf("Could not register service\n"); } } - + public void exit() { quit(); window.quit(); } - + public signal void quit(); } @@ -55,7 +55,7 @@ stderr.printf("Could not register service\n"); } } - + public void show_or_hide() { this.quake_window.toggle_quake_window(); } @@ -67,41 +67,41 @@ } -const string GETTEXT_PACKAGE = "deepin-terminal"; +const string GETTEXT_PACKAGE = "deepin-terminal"; public class Application : Object { - - private static bool quake_mode = false; + + private static bool quake_mode = false; private static string? window_mode = null; - private static string? work_directory = null; + private static string? work_directory = null; private static string? load_theme = null; // pass_options just for print help information, we need parse -e or -x commands myself. [CCode (array_length = false, array_null_terminated = true)] - public static string[]? pass_options = null; - + public static string[]? pass_options = null; + public Widgets.QuakeWindow quake_window; public Widgets.Window window; public WorkspaceManager workspace_manager; public static ArrayList commands; public static int64 start_time; - + private bool inited = false; private static bool version = false; public static void main(string[] args) { start_time = GLib.get_real_time() / 1000; - + // NOTE: set IBUS_NO_SNOOPER_APPS variable to avoid Ctrl + 5 eat by input method (such as fcitx.); Environment.set_variable("IBUS_DISABLE_SNOOPER", "1", true); - // Set 'NO_AT_BRIDGE' environment variable with 1 to dislable accessibility dbus warning. + // Set 'NO_AT_BRIDGE' environment variable with 1 to dislable accessibility dbus warning. Environment.set_variable("NO_AT_BRIDGE", "1", true); - + Intl.setlocale(); Intl.bind_textdomain_codeset(GETTEXT_PACKAGE, "utf-8"); Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); - + // Need parse -e or -x commands my self, OptionEntry just will got first argument after -e or -x. commands = new ArrayList(); bool find_command_flag = false; @@ -109,44 +109,44 @@ if (find_command_flag) { commands.add(arg); } - + if (arg == "-e" || arg == "-x") { find_command_flag = true; } } - + try { string window_mode_description = "%s (normal, maximize, fullscreen)".printf(_("Set the terminal window mode")); - + GLib.OptionEntry[] pass_options = { OptionEntry() { - long_name="version", - short_name=0, - flags=0, - arg=OptionArg.NONE, + long_name="version", + short_name=0, + flags=0, + arg=OptionArg.NONE, arg_data=&version, - description=_("Display version"), + description=_("Display version"), arg_description=null }, OptionEntry() { long_name="work-directory", - short_name='w', - flags=0, - arg=OptionArg.FILENAME, + short_name='w', + flags=0, + arg=OptionArg.FILENAME, arg_data=&work_directory, - description=_("Set the terminal startup directory"), + description=_("Set the terminal startup directory"), arg_description=null }, OptionEntry() { long_name="window-mode", - short_name='m', - flags=0, - arg=OptionArg.STRING, + short_name='m', + flags=0, + arg=OptionArg.STRING, arg_data=&window_mode, description=window_mode_description, arg_description=null }, - OptionEntry() { + OptionEntry() { long_name="execute", short_name='e', flags=0, @@ -155,7 +155,7 @@ description=_("Run a program in the terminal"), arg_description=null }, - OptionEntry() { + OptionEntry() { long_name="execute", short_name='x', flags=0, @@ -164,7 +164,7 @@ description=_("Run a program in the terminal"), arg_description=null }, - OptionEntry() { + OptionEntry() { long_name="quake-mode", short_name='q', flags=0, @@ -175,9 +175,9 @@ }, OptionEntry() { long_name="load-theme", - short_name='l', - flags=0, - arg=OptionArg.STRING, + short_name='l', + flags=0, + arg=OptionArg.STRING, arg_data=&load_theme, description=_("Load theme"), arg_description=null @@ -185,24 +185,24 @@ OptionEntry() }; - var opt_context = new OptionContext(_("Deepin Terminal")); + var opt_context = new OptionContext(_("Deepin Terminal")); opt_context.set_summary(_("Deepin Terminal is an advanced terminal emulator with workspace, multiple windows, remote management, quake mode and other features.\n\nIt sharpens your focus in the world of command line!")); - opt_context.set_help_enabled(true); - opt_context.add_main_entries(pass_options, null); - opt_context.parse(ref args); - } catch (OptionError e) { + opt_context.set_help_enabled(true); + opt_context.add_main_entries(pass_options, null); + opt_context.parse(ref args); + } catch (OptionError e) { // Don't print option error, avoid confuse user. - } + } if (version) { - stdout.printf("Deepin Terminal %s\n".printf(Constant.VERSION)); + stdout.printf("Deepin Terminal %s\n".printf(Constant.VERSION)); stdout.printf ("Copyright 2011-2017 Deepin, Inc.\n"); } else { Gtk.init(ref args); - + // Just for debug perfermance. // Gdk.Window.set_debug_updates(true); - + if (quake_mode) { QuakeTerminalApp app = new QuakeTerminalApp(); Bus.own_name(BusType.SESSION, @@ -220,7 +220,7 @@ () => {app.run(false);}, () => {app.run(true);}); } - + Gtk.main(); } } @@ -240,14 +240,14 @@ } catch (IOError e) { stderr.printf("%s\n", e.message); } - + Gtk.main_quit(); } else { Utils.load_css_theme(Utils.get_root_path("style.css")); - + Tabbar tabbar = new Tabbar(); - workspace_manager = new WorkspaceManager(tabbar, work_directory); - + workspace_manager = new WorkspaceManager(tabbar, work_directory); + if (quake_mode) { quake_window = new Widgets.QuakeWindow(); quake_window.show_window(workspace_manager, tabbar); @@ -260,12 +260,12 @@ if (load_theme != null) { window.config.load_temp_theme(load_theme); } - + window.show_window((TerminalApp) this, workspace_manager, tabbar, has_start); Utils.write_log("Deepin terminal start in: %s\n".printf((GLib.get_real_time() / 1000 - Application.start_time).to_string())); tabbar.init(workspace_manager, window); } - + } } } diff -Nru deepin-terminal-3.0.3+ds/po/ast/LC_MESSAGES/deepin-terminal.po deepin-terminal-3.0.7/po/ast/LC_MESSAGES/deepin-terminal.po --- deepin-terminal-3.0.3+ds/po/ast/LC_MESSAGES/deepin-terminal.po 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/po/ast/LC_MESSAGES/deepin-terminal.po 2018-10-06 18:03:56.000000000 +0000 @@ -276,7 +276,7 @@ #: ../widget/terminal.vala:398 msgid "Find" -msgstr "" +msgstr "Alcontrar" #: ../widget/preference.vala:291 msgid "Font size:" @@ -392,7 +392,7 @@ #: ../widget/terminal.vala:368 msgid "Open in file manager" -msgstr "" +msgstr "Abrir nel xestor de ficheros" #: ../widget/preference.vala:304 msgid "Open:" diff -Nru deepin-terminal-3.0.3+ds/po/bn/LC_MESSAGES/deepin-terminal.po deepin-terminal-3.0.7/po/bn/LC_MESSAGES/deepin-terminal.po --- deepin-terminal-3.0.3+ds/po/bn/LC_MESSAGES/deepin-terminal.po 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/po/bn/LC_MESSAGES/deepin-terminal.po 2018-10-06 18:03:56.000000000 +0000 @@ -26,7 +26,7 @@ #: ../widget/appbar.vala:129 msgid "About" -msgstr "" +msgstr "সম্পর্কে" #: ../widget/about_widget.vala:81 msgid "Acknowledgments" @@ -34,7 +34,7 @@ #: ../widget/remote_server_dialog.vala:352 ../widget/command_dialog.vala:197 msgid "Add" -msgstr "" +msgstr "যোগ করুন" #: ../widget/command_dialog.vala:126 msgid "Add Command" @@ -64,7 +64,7 @@ #: ../widget/preference.vala:332 ../widget/preference.vala:344 #: ../widget/config_window.vala:366 msgid "Advanced" -msgstr "" +msgstr "উন্নত" #: ../widget/remote_server_dialog.vala:337 msgid "Advanced options" @@ -136,7 +136,7 @@ #: ../widget/remote_server_dialog.vala:107 msgid "Command" -msgstr "" +msgstr "কমান্ড" #: ../widget/remote_server_dialog.vala:295 ../widget/command_dialog.vala:172 msgid "Command:" @@ -210,7 +210,7 @@ #: ../widget/remote_server_dialog.vala:428 ../widget/command_dialog.vala:251 #: ../widget/entry_menu.vala:44 msgid "Delete" -msgstr "" +msgstr "মুছে ফেলুন" #: ../widget/command_dialog.vala:238 ../widget/command_dialog.vala:248 msgid "Delete command" @@ -299,7 +299,7 @@ #: ../widget/appbar.vala:127 msgid "Help" -msgstr "" +msgstr "সাহায্য করুন" #: ../widget/preference.vala:400 msgid "Hide quake window after lost focus" @@ -315,7 +315,7 @@ #: ../widget/preference_slidebar.vala:58 ../widget/preference.vala:250 msgid "Interface" -msgstr "" +msgstr "ইন্টারফেস" #: ../widget/config_window.vala:312 msgid "Jump to next command" @@ -397,7 +397,7 @@ #: ../widget/remote_server_dialog.vala:285 #: ../widget/remote_server_dialog.vala:294 msgid "Optional" -msgstr "" +msgstr "ঐচ্ছিক" #: ../widget/remote_server_dialog.vala:107 msgid "Password" @@ -426,7 +426,7 @@ #: ../widget/shortcut_entry.vala:147 msgid "Please enter a new shortcut" -msgstr "" +msgstr "অনুগ্রহ করে একটি নতুন শর্টকাট প্রবেশ করান" #: ../widget/remote_server_dialog.vala:199 msgid "Port:" @@ -475,7 +475,7 @@ #: ../widget/remote_server_dialog.vala:232 ../widget/command_dialog.vala:158 #: ../widget/command_dialog.vala:171 msgid "Required" -msgstr "" +msgstr "আবশ্যক" #: ../widget/preference.vala:413 msgid "Restore Defaults" @@ -487,7 +487,7 @@ #: ../widget/remote_server_dialog.vala:350 ../widget/command_dialog.vala:195 msgid "Save" -msgstr "" +msgstr "সংরক্ষণ করুন" #: ../widget/preference_slidebar.vala:87 ../widget/preference.vala:374 msgid "Scroll" @@ -504,7 +504,7 @@ #: ../widget/terminal.vala:401 ../widget/search_entry.vala:64 #: ../widget/search_entry.vala:66 ../widget/config_window.vala:307 msgid "Search" -msgstr "" +msgstr "খুঁজুন" #: ../widget/preference.vala:305 ../widget/remote_panel.vala:357 #: ../widget/command_panel.vala:201 @@ -658,7 +658,7 @@ #: ../widget/preference_slidebar.vala:90 ../widget/preference.vala:383 msgid "Window" -msgstr "" +msgstr "উইন্ডো" #: ../widget/preference_slidebar.vala:71 ../widget/preference.vala:313 #: ../widget/config_window.vala:348 diff -Nru deepin-terminal-3.0.3+ds/po/ca/LC_MESSAGES/deepin-terminal.po deepin-terminal-3.0.7/po/ca/LC_MESSAGES/deepin-terminal.po --- deepin-terminal-3.0.3+ds/po/ca/LC_MESSAGES/deepin-terminal.po 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/po/ca/LC_MESSAGES/deepin-terminal.po 2018-10-06 18:03:56.000000000 +0000 @@ -671,7 +671,7 @@ #: ../widget/preference_slidebar.vala:71 ../widget/preference.vala:313 #: ../widget/config_window.vala:348 msgid "Workspace" -msgstr "Workspace" +msgstr "Espai de treball" #: ../widget/config_window.vala:308 msgid "Zoom in" diff -Nru deepin-terminal-3.0.3+ds/po/hi_IN/LC_MESSAGES/deepin-terminal.po deepin-terminal-3.0.7/po/hi_IN/LC_MESSAGES/deepin-terminal.po --- deepin-terminal-3.0.3+ds/po/hi_IN/LC_MESSAGES/deepin-terminal.po 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/po/hi_IN/LC_MESSAGES/deepin-terminal.po 2018-10-06 18:03:56.000000000 +0000 @@ -10,7 +10,7 @@ "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-04-08 12:45+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: e2f_in_c3 , 2017\n" +"Last-Translator: Panwar108 , 2018\n" "Language-Team: Hindi (India) (https://www.transifex.com/linuxdeepin/teams/3976/hi_IN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -397,7 +397,7 @@ #: ../widget/remote_server_dialog.vala:285 #: ../widget/remote_server_dialog.vala:294 msgid "Optional" -msgstr "" +msgstr "वैकल्पिक" #: ../widget/remote_server_dialog.vala:107 msgid "Password" @@ -426,7 +426,7 @@ #: ../widget/shortcut_entry.vala:147 msgid "Please enter a new shortcut" -msgstr "" +msgstr "कृपया नया शॉर्टकट दर्ज करें" #: ../widget/remote_server_dialog.vala:199 msgid "Port:" @@ -475,7 +475,7 @@ #: ../widget/remote_server_dialog.vala:232 ../widget/command_dialog.vala:158 #: ../widget/command_dialog.vala:171 msgid "Required" -msgstr "" +msgstr "आवश्यक" #: ../widget/preference.vala:413 msgid "Restore Defaults" @@ -594,7 +594,7 @@ #: ../widget/preference_slidebar.vala:65 ../widget/preference.vala:293 #: ../widget/command_dialog.vala:83 msgid "Shortcuts" -msgstr "" +msgstr "शॉर्टकट" #: ../widget/command_dialog.vala:180 msgid "Shortcuts:" diff -Nru deepin-terminal-3.0.3+ds/po/id/LC_MESSAGES/deepin-terminal.po deepin-terminal-3.0.7/po/id/LC_MESSAGES/deepin-terminal.po --- deepin-terminal-3.0.3+ds/po/id/LC_MESSAGES/deepin-terminal.po 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/po/id/LC_MESSAGES/deepin-terminal.po 2018-10-06 18:03:56.000000000 +0000 @@ -276,7 +276,7 @@ #: ../widget/terminal.vala:398 msgid "Find" -msgstr "" +msgstr "Temukan" #: ../widget/preference.vala:291 msgid "Font size:" @@ -392,7 +392,7 @@ #: ../widget/terminal.vala:368 msgid "Open in file manager" -msgstr "" +msgstr "Buka pada manajer berkas" #: ../widget/preference.vala:304 msgid "Open:" @@ -464,16 +464,16 @@ #: ../widget/terminal.vala:639 msgid "Rename" -msgstr "Rename" +msgstr "Ganti nama" #: ../widget/terminal.vala:441 ../widget/terminal.vala:636 #: ../widget/config_window.vala:357 msgid "Rename title" -msgstr "Rubah judul" +msgstr "Ubah judul" #: ../widget/preference.vala:339 msgid "Rename title:" -msgstr "Rubah judul:" +msgstr "Ubah judul:" #: ../widget/remote_server_dialog.vala:186 #: ../widget/remote_server_dialog.vala:196 diff -Nru deepin-terminal-3.0.3+ds/po/nb/LC_MESSAGES/deepin-terminal.po deepin-terminal-3.0.7/po/nb/LC_MESSAGES/deepin-terminal.po --- deepin-terminal-3.0.3+ds/po/nb/LC_MESSAGES/deepin-terminal.po 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/po/nb/LC_MESSAGES/deepin-terminal.po 2018-10-06 18:03:56.000000000 +0000 @@ -10,7 +10,7 @@ "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-04-08 12:45+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: heimeg , 2017\n" +"Last-Translator: hansa71 , 2017\n" "Language-Team: Norwegian Bokmål (https://www.transifex.com/linuxdeepin/teams/3976/nb/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -94,7 +94,7 @@ #: ../widget/preference.vala:407 msgid "Blur background" -msgstr "" +msgstr "Uklar bakgrunn" #: ../widget/remote_server_dialog.vala:347 #: ../widget/remote_server_dialog.vala:427 ../widget/confirm_dialog.vala:131 @@ -167,7 +167,7 @@ #: ../widget/preference.vala:372 msgid "Cursor autohide" -msgstr "" +msgstr "Gjem markør automatisk" #: ../widget/preference.vala:371 msgid "Cursor blink" @@ -276,7 +276,7 @@ #: ../widget/terminal.vala:398 msgid "Find" -msgstr "" +msgstr "Finn" #: ../widget/preference.vala:291 msgid "Font size:" @@ -340,7 +340,7 @@ #: ../main.vala:182 msgid "Load theme" -msgstr "" +msgstr "Last inn tema" #: ../widget/preference.vala:395 msgid "Maximize" @@ -356,7 +356,7 @@ #: ../widget/config_window.vala:335 msgid "New theme terminal" -msgstr "" +msgstr "Nytt tema til terminal" #: ../widget/appbar.vala:120 msgid "New window" @@ -392,7 +392,7 @@ #: ../widget/terminal.vala:368 msgid "Open in file manager" -msgstr "" +msgstr "Åpne i filbehandleren" #: ../widget/preference.vala:304 msgid "Open:" @@ -431,7 +431,7 @@ #: ../widget/shortcut_entry.vala:147 msgid "Please enter a new shortcut" -msgstr "Vennligst oppgi en ny hurtightast" +msgstr "Vennligst oppgi en ny hurtigtast" #: ../widget/remote_server_dialog.vala:199 msgid "Port:" @@ -464,27 +464,27 @@ #: ../widget/terminal.vala:639 msgid "Rename" -msgstr "Omdøp" +msgstr "Endre navn" #: ../widget/terminal.vala:441 ../widget/terminal.vala:636 #: ../widget/config_window.vala:357 msgid "Rename title" -msgstr "" +msgstr "Endre tittel" #: ../widget/preference.vala:339 msgid "Rename title:" -msgstr "" +msgstr "Endre tittel:" #: ../widget/remote_server_dialog.vala:186 #: ../widget/remote_server_dialog.vala:196 #: ../widget/remote_server_dialog.vala:232 ../widget/command_dialog.vala:158 #: ../widget/command_dialog.vala:171 msgid "Required" -msgstr "Pårekvd" +msgstr "Påkrevd" #: ../widget/preference.vala:413 msgid "Restore Defaults" -msgstr "" +msgstr "Gjenopprett Standard" #: ../main.vala:155 ../main.vala:164 msgid "Run a program in the terminal" diff -Nru deepin-terminal-3.0.3+ds/po/nl/LC_MESSAGES/deepin-terminal.po deepin-terminal-3.0.7/po/nl/LC_MESSAGES/deepin-terminal.po --- deepin-terminal-3.0.3+ds/po/nl/LC_MESSAGES/deepin-terminal.po 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/po/nl/LC_MESSAGES/deepin-terminal.po 2018-10-06 18:03:56.000000000 +0000 @@ -276,7 +276,7 @@ #: ../widget/terminal.vala:398 msgid "Find" -msgstr "" +msgstr "Zoeken" #: ../widget/preference.vala:291 msgid "Font size:" @@ -308,7 +308,7 @@ #: ../widget/preference.vala:400 msgid "Hide quake window after lost focus" -msgstr "Verberg quakevenster na verlies van focus" +msgstr "Quake-venster verbergen na verliezen van focus" #: ../widget/terminal.vala:378 ../widget/config_window.vala:337 msgid "Horizontal split" @@ -356,7 +356,7 @@ #: ../widget/config_window.vala:335 msgid "New theme terminal" -msgstr "Nieuw terminal thema" +msgstr "Nieuw terminalthema" #: ../widget/appbar.vala:120 msgid "New window" @@ -392,7 +392,7 @@ #: ../widget/terminal.vala:368 msgid "Open in file manager" -msgstr "" +msgstr "Openen in bestandsbeheerder" #: ../widget/preference.vala:304 msgid "Open:" @@ -464,16 +464,16 @@ #: ../widget/terminal.vala:639 msgid "Rename" -msgstr "Hernoemen" +msgstr "Naam wijzigen" #: ../widget/terminal.vala:441 ../widget/terminal.vala:636 #: ../widget/config_window.vala:357 msgid "Rename title" -msgstr "Titel hernoemen" +msgstr "Titelnaam wijzigen" #: ../widget/preference.vala:339 msgid "Rename title:" -msgstr "Titel hernoemen:" +msgstr "Titelnaam wijzigen:" #: ../widget/remote_server_dialog.vala:186 #: ../widget/remote_server_dialog.vala:196 diff -Nru deepin-terminal-3.0.3+ds/po/pt/LC_MESSAGES/deepin-terminal.po deepin-terminal-3.0.7/po/pt/LC_MESSAGES/deepin-terminal.po --- deepin-terminal-3.0.3+ds/po/pt/LC_MESSAGES/deepin-terminal.po 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/po/pt/LC_MESSAGES/deepin-terminal.po 2018-10-06 18:03:56.000000000 +0000 @@ -10,7 +10,7 @@ "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-04-08 12:45+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Joao Pedro Correia da Silva Carvalhinho , 2017\n" +"Last-Translator: João P Carvalhinho , 2017\n" "Language-Team: Portuguese (https://www.transifex.com/linuxdeepin/teams/3976/pt/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff -Nru deepin-terminal-3.0.3+ds/po/sr/LC_MESSAGES/deepin-terminal.po deepin-terminal-3.0.7/po/sr/LC_MESSAGES/deepin-terminal.po --- deepin-terminal-3.0.3+ds/po/sr/LC_MESSAGES/deepin-terminal.po 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/po/sr/LC_MESSAGES/deepin-terminal.po 2018-10-06 18:03:56.000000000 +0000 @@ -40,11 +40,11 @@ #: ../widget/command_dialog.vala:126 msgid "Add Command" -msgstr "Додај Команду" +msgstr "Додај команду" #: ../widget/remote_server_dialog.vala:154 msgid "Add Server" -msgstr "Додај Сервер" +msgstr "Додај сервер" #: ../widget/command_panel.vala:311 msgid "Add command" @@ -82,11 +82,11 @@ #: ../widget/remote_server_dialog.vala:107 msgid "Backspace key" -msgstr "" +msgstr "Backspace тастер" #: ../widget/remote_server_dialog.vala:321 msgid "Backspace key:" -msgstr "" +msgstr "Backspace тастер:" #: ../widget/preference_slidebar.vala:55 ../widget/preference.vala:247 msgid "Basic" @@ -94,7 +94,7 @@ #: ../widget/preference.vala:407 msgid "Blur background" -msgstr "" +msgstr "Замагљена позадина" #: ../widget/remote_server_dialog.vala:347 #: ../widget/remote_server_dialog.vala:427 ../widget/confirm_dialog.vala:131 @@ -106,11 +106,11 @@ #: ../widget/remote_server_dialog.vala:107 msgid "Certificate" -msgstr "" +msgstr "Сертификат" #: ../widget/remote_server_dialog.vala:261 msgid "Certificate:" -msgstr "" +msgstr "Сертификат:" #: ../widget/terminal.vala:382 ../widget/config_window.vala:343 msgid "Close other windows" @@ -167,24 +167,24 @@ #: ../widget/preference.vala:372 msgid "Cursor autohide" -msgstr "" +msgstr "Самоскривање показивача" #: ../widget/preference.vala:371 msgid "Cursor blink" -msgstr "" +msgstr "Трептање показивача" #: ../widget/preference.vala:199 msgid "Cursor style:" -msgstr "" +msgstr "Стил показивача:" #: ../widget/terminal.vala:443 ../widget/config_window.vala:360 #: ../widget/appbar.vala:122 msgid "Custom commands" -msgstr "" +msgstr "Прилагођене команде" #: ../widget/preference.vala:341 msgid "Custom commands:" -msgstr "" +msgstr "Прилагођене команде:" #: ../widget/entry_menu.vala:38 msgid "Cut" @@ -200,6 +200,9 @@ "\n" "It sharpens your focus in the world of command line!" msgstr "" +"Дипин Терминал је напредни емулатор терминала са радним просторима, вишеструким прозорима, даљинским управљањем, спуштајућим режимом и осталим функцијама.\n" +"\n" +"Изоштрава ваш фокус у свету командне линије!" #: ../widget/config_window.vala:310 msgid "Default size" @@ -220,11 +223,11 @@ #: ../widget/remote_server_dialog.vala:107 msgid "Delete key" -msgstr "" +msgstr "Delete тастер" #: ../widget/remote_server_dialog.vala:334 msgid "Delete key:" -msgstr "" +msgstr "Delete тастер:" #: ../widget/remote_server_dialog.vala:415 #: ../widget/remote_server_dialog.vala:425 @@ -245,23 +248,23 @@ #: ../widget/terminal.vala:448 msgid "Download file" -msgstr "" +msgstr "Преузми датотеку" #: ../widget/command_dialog.vala:124 msgid "Edit Command" -msgstr "Уреди Команду" +msgstr "Уреди команду" #: ../widget/remote_server_dialog.vala:152 msgid "Edit Server" -msgstr "Уреди Сервер" +msgstr "Уреди сервер" #: ../widget/remote_server_dialog.vala:107 ../widget/terminal.vala:442 msgid "Encoding" -msgstr "" +msgstr "Кодирање" #: ../widget/remote_server_dialog.vala:308 msgid "Encoding:" -msgstr "" +msgstr "Кодирање:" #: ../widget/confirm_dialog.vala:131 ../widget/appbar.vala:130 msgid "Exit" @@ -269,11 +272,11 @@ #: ../widget/terminal.vala:392 msgid "Exit fullscreen" -msgstr "Напусти пун екран" +msgstr "Напусти цео екран" #: ../widget/terminal.vala:398 msgid "Find" -msgstr "" +msgstr "Пронађи" #: ../widget/preference.vala:291 msgid "Font size:" @@ -285,19 +288,19 @@ #: ../widget/preference.vala:396 ../widget/terminal.vala:394 msgid "Fullscreen" -msgstr "Пун Екран" +msgstr "Цео екран" #: ../widget/preference.vala:338 msgid "Fullscreen:" -msgstr "Пун Екран:" +msgstr "Цео екран:" #: ../widget/remote_server_dialog.vala:107 msgid "Group" -msgstr "" +msgstr "Група" #: ../widget/remote_server_dialog.vala:277 msgid "Group:" -msgstr "" +msgstr "Група:" #: ../widget/appbar.vala:127 msgid "Help" @@ -305,7 +308,7 @@ #: ../widget/preference.vala:400 msgid "Hide quake window after lost focus" -msgstr "" +msgstr "Сакриј спуштајући терминал када није у фокусу" #: ../widget/terminal.vala:378 ../widget/config_window.vala:337 msgid "Horizontal split" @@ -317,23 +320,23 @@ #: ../widget/preference_slidebar.vala:58 ../widget/preference.vala:250 msgid "Interface" -msgstr "Сучеља" +msgstr "Сучеље" #: ../widget/config_window.vala:312 msgid "Jump to next command" -msgstr "" +msgstr "Иди на следећу команду" #: ../widget/preference.vala:309 msgid "Jump to next command:" -msgstr "" +msgstr "Иди на следећу команду:" #: ../widget/config_window.vala:313 msgid "Jump to previous command" -msgstr "" +msgstr "Иди на претходну команду" #: ../widget/preference.vala:310 msgid "Jump to previous command:" -msgstr "" +msgstr "Иди на претходну команду:" #: ../main.vala:182 msgid "Load theme" @@ -341,7 +344,7 @@ #: ../widget/preference.vala:395 msgid "Maximize" -msgstr "" +msgstr "Максимизуј" #: ../widget/command_dialog.vala:83 msgid "Name" @@ -353,7 +356,7 @@ #: ../widget/config_window.vala:335 msgid "New theme terminal" -msgstr "" +msgstr "Нова тема терминала" #: ../widget/appbar.vala:120 msgid "New window" @@ -436,28 +439,28 @@ #: ../widget/config_window.vala:333 msgid "Previous workspace" -msgstr "" +msgstr "Претходни радни простор" #: ../widget/preference.vala:321 msgid "Previous workspace:" -msgstr "" +msgstr "Претходни радни простор:" #: ../widget/confirm_dialog.vala:131 msgid "Programs are still running in terminal" -msgstr "" +msgstr "Програми још раде у терминалу" #: ../main.vala:173 msgid "Quake mode" -msgstr "" +msgstr "Спуштајући режим" #: ../widget/terminal.vala:444 ../widget/config_window.vala:361 #: ../widget/appbar.vala:123 msgid "Remote management" -msgstr "" +msgstr "Даљинско управљање" #: ../widget/preference.vala:342 msgid "Remote management:" -msgstr "" +msgstr "Даљинско управљање:" #: ../widget/terminal.vala:639 msgid "Rename" @@ -466,11 +469,11 @@ #: ../widget/terminal.vala:441 ../widget/terminal.vala:636 #: ../widget/config_window.vala:357 msgid "Rename title" -msgstr "Преименуј наслов" +msgstr "Промени наслов" #: ../widget/preference.vala:339 msgid "Rename title:" -msgstr "Преименуј наслов:" +msgstr "Промени наслов:" #: ../widget/remote_server_dialog.vala:186 #: ../widget/remote_server_dialog.vala:196 @@ -497,11 +500,11 @@ #: ../widget/preference.vala:380 msgid "Scroll on keystroke" -msgstr "" +msgstr "Клизај притиском на тастер" #: ../widget/preference.vala:381 msgid "Scroll on output" -msgstr "" +msgstr "Клизај по излазима" #: ../widget/terminal.vala:401 ../widget/search_entry.vala:64 #: ../widget/search_entry.vala:66 ../widget/config_window.vala:307 @@ -515,59 +518,59 @@ #: ../widget/terminal.vala:605 ../widget/file_button.vala:71 msgid "Select" -msgstr "Изабери" +msgstr "Одабери" #: ../widget/config_window.vala:311 ../widget/entry_menu.vala:47 msgid "Select all" -msgstr "Изабери све" +msgstr "Одабери све" #: ../widget/preference.vala:311 msgid "Select all:" -msgstr "" +msgstr "Одабери све:" #: ../widget/terminal.vala:603 msgid "Select directory to save download file" -msgstr "" +msgstr "Одабери директоријум за чување преузете датотеке" #: ../widget/terminal.vala:574 msgid "Select file to upload" -msgstr "" +msgstr "Одабери датотеку за отпремање" #: ../widget/config_window.vala:340 msgid "Select left window" -msgstr "" +msgstr "Одабери леви прозор" #: ../widget/preference.vala:327 msgid "Select left window:" -msgstr "" +msgstr "Одабери леви прозор:" #: ../widget/config_window.vala:339 msgid "Select lower window" -msgstr "" +msgstr "Одабери доњи прозор" #: ../widget/preference.vala:326 msgid "Select lower window:" -msgstr "" +msgstr "Одабери доњи прозор:" #: ../widget/config_window.vala:341 msgid "Select right window" -msgstr "" +msgstr "Одабери десни прозор" #: ../widget/preference.vala:328 msgid "Select right window:" -msgstr "" +msgstr "Одабери десни прозор:" #: ../widget/file_button.vala:67 msgid "Select the private key file" -msgstr "" +msgstr "Одабери датотеку са приватним кључем" #: ../widget/config_window.vala:338 msgid "Select upper window" -msgstr "" +msgstr "Одабери горњи прозор" #: ../widget/preference.vala:325 msgid "Select upper window:" -msgstr "" +msgstr "Одабери горњи прозор:" #: ../widget/config_window.vala:334 msgid "Select workspace" @@ -583,11 +586,11 @@ #: ../main.vala:137 msgid "Set the terminal startup directory" -msgstr "" +msgstr "Постави почетни директоријум терминала" #: ../main.vala:119 msgid "Set the terminal window mode" -msgstr "" +msgstr "Постави режим прозора терминала" #: ../widget/terminal.vala:452 ../widget/appbar.vala:125 msgid "Settings" @@ -604,7 +607,7 @@ #: ../widget/config_window.vala:358 msgid "Switch fullscreen" -msgstr "" +msgstr "Пребаци на цео екран" #: ../widget/terminal.vala:439 ../widget/appbar.vala:121 msgid "Switch theme" @@ -617,19 +620,19 @@ #: ../widget/terminal.vala:617 msgid "Type path for download file" -msgstr "" +msgstr "Унеси путању за преузимање датотеке" #: ../widget/terminal.vala:578 msgid "Upload" -msgstr "" +msgstr "Отпреми" #: ../widget/terminal.vala:447 msgid "Upload file" -msgstr "" +msgstr "Отпреми датотеку" #: ../widget/preference.vala:397 msgid "Use on starting:" -msgstr "" +msgstr "Користи при покретању:" #: ../widget/remote_server_dialog.vala:107 msgid "Username" @@ -645,11 +648,11 @@ #: ../widget/terminal.vala:379 ../widget/config_window.vala:336 msgid "Vertical split" -msgstr "" +msgstr "Вертикална подела" #: ../widget/preference.vala:323 msgid "Vertical split:" -msgstr "" +msgstr "Вертикална подела:" #: ../widget/terminal.vala:1544 msgid "" @@ -657,6 +660,8 @@ "been installed in the server before right clicking to upload and download " "files." msgstr "" +"Добро дошли у Дипин Терминал, уверите се да су rz и sz команде инсталиране " +"на серверу пре коришћења десног клика за преузимање и отпремање датотека." #: ../widget/preference_slidebar.vala:90 ../widget/preference.vala:383 msgid "Window" @@ -669,20 +674,20 @@ #: ../widget/config_window.vala:308 msgid "Zoom in" -msgstr "" +msgstr "Увеличај" #: ../widget/preference.vala:306 msgid "Zoom in:" -msgstr "" +msgstr "Увеличај:" #: ../widget/config_window.vala:309 msgid "Zoom out" -msgstr "" +msgstr "Умањи" #: ../widget/preference.vala:307 msgid "Zoom out:" -msgstr "" +msgstr "Умањи:" #: ../widget/terminal.vala:787 ../widget/terminal.vala:1267 msgid "deepin" -msgstr "" +msgstr "deepin" diff -Nru deepin-terminal-3.0.3+ds/vapi/fontconfig.vapi deepin-terminal-3.0.7/vapi/fontconfig.vapi --- deepin-terminal-3.0.3+ds/vapi/fontconfig.vapi 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/vapi/fontconfig.vapi 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 4 -*- - * -*- coding: utf-8 -*- - * - * Copyright (C) 2011 ~ 2016 Deepin, Inc. - * 2011 ~ 2016 Wang Yong - * - * Author: Wang Yong - * Maintainer: Wang Yong - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/* - * This empty file used to compile deepin-terminal/lib/font.c . - * Don't delete thise file. - * - */ \ No newline at end of file diff -Nru deepin-terminal-3.0.3+ds/vapi/gee-1.0.vapi deepin-terminal-3.0.7/vapi/gee-1.0.vapi --- deepin-terminal-3.0.3+ds/vapi/gee-1.0.vapi 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/vapi/gee-1.0.vapi 1970-01-01 00:00:00.000000000 +0000 @@ -1,414 +0,0 @@ -/* gee-1.0.vapi generated by valac 0.24.0.89-24e8-dirty, do not modify. */ - -[CCode (gir_namespace = "Gee", gir_version = "1.0")] -namespace Gee { - namespace Functions { - [CCode (cheader_filename = "gee.h")] - public static GLib.CompareFunc get_compare_func_for (GLib.Type t); - [CCode (cheader_filename = "gee.h")] - public static GLib.EqualFunc get_equal_func_for (GLib.Type t); - [CCode (cheader_filename = "gee.h")] - public static GLib.HashFunc get_hash_func_for (GLib.Type t); - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractCollection : GLib.Object, Gee.Iterable, Gee.Collection { - public AbstractCollection (); - public abstract bool add (G item); - public virtual bool add_all (Gee.Collection collection); - public abstract void clear (); - public abstract bool contains (G item); - public virtual bool contains_all (Gee.Collection collection); - public abstract Gee.Iterator iterator (); - public abstract bool remove (G item); - public virtual bool remove_all (Gee.Collection collection); - public virtual bool retain_all (Gee.Collection collection); - public virtual G[] to_array (); - public virtual bool is_empty { get; } - public virtual Gee.Collection read_only_view { owned get; } - public abstract int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractList : Gee.AbstractCollection, Gee.List { - public AbstractList (); - public virtual G first (); - public abstract new G @get (int index); - public abstract int index_of (G item); - public abstract void insert (int index, G item); - public virtual void insert_all (int index, Gee.Collection collection); - public virtual G last (); - public abstract Gee.ListIterator list_iterator (); - public abstract G remove_at (int index); - public abstract new void @set (int index, G item); - public abstract Gee.List? slice (int start, int stop); - public virtual Gee.List read_only_view { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractMap : GLib.Object, Gee.Iterable>, Gee.Map { - public AbstractMap (); - public abstract void clear (); - public abstract new V @get (K key); - public abstract bool has (K key, V value); - public virtual bool has_all (Gee.Map map); - public abstract bool has_key (K key); - public abstract Gee.MapIterator map_iterator (); - public abstract new void @set (K key, V value); - public virtual void set_all (Gee.Map map); - public abstract bool unset (K key, out V value = null); - public virtual bool unset_all (Gee.Map map); - public abstract Gee.Set> entries { owned get; } - public virtual bool is_empty { get; } - public abstract Gee.Set keys { owned get; } - public virtual Gee.Map read_only_view { owned get; } - public abstract int size { get; } - public abstract Gee.Collection values { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractMultiMap : GLib.Object, Gee.MultiMap { - protected Gee.Map> _storage_map; - public AbstractMultiMap (Gee.Map> storage_map); - protected abstract Gee.MultiSet create_multi_key_set (); - protected abstract Gee.Collection create_value_storage (); - protected abstract GLib.EqualFunc get_value_equal_func (); - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractMultiSet : Gee.AbstractCollection, Gee.MultiSet { - protected Gee.Map _storage_map; - public AbstractMultiSet (Gee.Map storage_map); - public override bool add (G item); - public override void clear (); - public override bool contains (G item); - public override Gee.Iterator iterator (); - public override bool remove (G item); - public override int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractQueue : Gee.AbstractCollection, Gee.Queue { - public AbstractQueue (); - public abstract int drain (Gee.Collection recipient, int amount = -1); - public abstract bool offer (G element); - public abstract G peek (); - public abstract G poll (); - public abstract int capacity { get; } - public abstract bool is_full { get; } - public abstract int remaining_capacity { get; } - } - [CCode (cheader_filename = "gee.h")] - public abstract class AbstractSet : Gee.AbstractCollection, Gee.Set { - public AbstractSet (); - public virtual Gee.Set read_only_view { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public class ArrayList : Gee.AbstractList { - public ArrayList (GLib.EqualFunc? equal_func = null); - public override bool add (G item); - public override bool add_all (Gee.Collection collection); - public override void clear (); - public override bool contains (G item); - public override G @get (int index); - public override int index_of (G item); - public override void insert (int index, G item); - public override Gee.Iterator iterator (); - public override Gee.ListIterator list_iterator (); - public override bool remove (G item); - public override G remove_at (int index); - public override void @set (int index, G item); - public override Gee.List? slice (int start, int stop); - public void sort_with_data (GLib.CompareDataFunc compare); - public GLib.EqualFunc equal_func { get; private set; } - public override int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public class HashMap : Gee.AbstractMap { - public HashMap (GLib.HashFunc? key_hash_func = null, GLib.EqualFunc? key_equal_func = null, GLib.EqualFunc? value_equal_func = null); - public override void clear (); - public override V @get (K key); - public override bool has (K key, V value); - public override bool has_key (K key); - public override Gee.MapIterator map_iterator (); - public override void @set (K key, V value); - public override bool unset (K key, out V value = null); - public override Gee.Set> entries { owned get; } - public GLib.EqualFunc key_equal_func { get; private set; } - public GLib.HashFunc key_hash_func { get; private set; } - public override Gee.Set keys { owned get; } - public override int size { get; } - public GLib.EqualFunc value_equal_func { get; private set; } - public override Gee.Collection values { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public class HashMultiMap : Gee.AbstractMultiMap { - public HashMultiMap (GLib.HashFunc? key_hash_func = null, GLib.EqualFunc? key_equal_func = null, GLib.HashFunc? value_hash_func = null, GLib.EqualFunc? value_equal_func = null); - protected override Gee.MultiSet create_multi_key_set (); - protected override Gee.Collection create_value_storage (); - protected override GLib.EqualFunc get_value_equal_func (); - public GLib.EqualFunc key_equal_func { get; } - public GLib.HashFunc key_hash_func { get; } - public GLib.EqualFunc value_equal_func { get; private set; } - public GLib.HashFunc value_hash_func { get; private set; } - } - [CCode (cheader_filename = "gee.h")] - public class HashMultiSet : Gee.AbstractMultiSet { - public HashMultiSet (GLib.HashFunc? hash_func = null, GLib.EqualFunc? equal_func = null); - public GLib.EqualFunc equal_func { get; } - public GLib.HashFunc hash_func { get; } - } - [CCode (cheader_filename = "gee.h")] - public class HashSet : Gee.AbstractSet { - public HashSet (GLib.HashFunc? hash_func = null, GLib.EqualFunc? equal_func = null); - public override bool add (G key); - public override void clear (); - public override bool contains (G key); - public override Gee.Iterator iterator (); - public override bool remove (G key); - public GLib.EqualFunc equal_func { get; private set; } - public GLib.HashFunc hash_func { get; private set; } - public override int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public class LinkedList : Gee.AbstractList, Gee.Queue, Gee.Deque { - public LinkedList (GLib.EqualFunc? equal_func = null); - public override bool add (G item); - public override void clear (); - public override bool contains (G item); - public override G first (); - public override G @get (int index); - public override int index_of (G item); - public override void insert (int index, G item); - public override Gee.Iterator iterator (); - public override G last (); - public override Gee.ListIterator list_iterator (); - public override bool remove (G item); - public override G remove_at (int index); - public override void @set (int index, G item); - public override Gee.List? slice (int start, int stop); - public GLib.EqualFunc equal_func { get; private set; } - public override int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public class PriorityQueue : Gee.AbstractQueue { - public PriorityQueue (GLib.CompareFunc? compare_func = null); - public override bool add (G item); - public override void clear (); - public override bool contains (G item); - public override int drain (Gee.Collection recipient, int amount = -1); - public override Gee.Iterator iterator (); - public override bool offer (G element); - public override G peek (); - public override G poll (); - public override bool remove (G item); - public override int capacity { get; } - public GLib.CompareFunc compare_func { get; private set; } - public override bool is_full { get; } - public override int remaining_capacity { get; } - public override int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public class TreeMap : Gee.AbstractMap { - public TreeMap (GLib.CompareFunc? key_compare_func = null, GLib.EqualFunc? value_equal_func = null); - public override void clear (); - public override V @get (K key); - public override bool has (K key, V value); - public override bool has_key (K key); - public override Gee.MapIterator map_iterator (); - public override void @set (K key, V value); - public override bool unset (K key, out V value = null); - public override Gee.Set> entries { owned get; } - public GLib.CompareFunc key_compare_func { get; private set; } - public override Gee.Set keys { owned get; } - public override int size { get; } - public GLib.EqualFunc value_equal_func { get; private set; } - public override Gee.Collection values { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public class TreeMultiMap : Gee.AbstractMultiMap { - public TreeMultiMap (GLib.CompareFunc? key_compare_func = null, GLib.CompareFunc? value_compare_func = null); - protected override Gee.MultiSet create_multi_key_set (); - protected override Gee.Collection create_value_storage (); - protected override GLib.EqualFunc get_value_equal_func (); - public GLib.CompareFunc key_compare_func { get; } - public GLib.CompareFunc value_compare_func { get; private set; } - } - [CCode (cheader_filename = "gee.h")] - public class TreeMultiSet : Gee.AbstractMultiSet { - public TreeMultiSet (GLib.CompareFunc? compare_func = null); - public GLib.CompareFunc compare_func { get; } - } - [CCode (cheader_filename = "gee.h")] - public class TreeSet : Gee.AbstractSet, Gee.SortedSet { - public TreeSet (GLib.CompareFunc? compare_func = null); - public override bool add (G item); - public override void clear (); - public override bool contains (G item); - public override Gee.Iterator iterator (); - public override bool remove (G item); - public GLib.CompareFunc compare_func { get; private set; } - public override int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public interface BidirIterator : Gee.Iterator { - public abstract bool has_previous (); - public abstract bool last (); - public abstract bool previous (); - } - [CCode (cheader_filename = "gee.h")] - public interface Collection : Gee.Iterable { - public abstract bool add (G item); - public abstract bool add_all (Gee.Collection collection); - public abstract void clear (); - public abstract bool contains (G item); - public abstract bool contains_all (Gee.Collection collection); - public static Gee.Collection empty (); - public abstract bool remove (G item); - public abstract bool remove_all (Gee.Collection collection); - public abstract bool retain_all (Gee.Collection collection); - public abstract G[] to_array (); - public abstract bool is_empty { get; } - public abstract Gee.Collection read_only_view { owned get; } - public abstract int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public interface Comparable : GLib.Object { - public abstract int compare_to (G object); - } - [CCode (cheader_filename = "gee.h")] - public interface Deque : Gee.Queue { - public abstract int drain_head (Gee.Collection recipient, int amount = -1); - public abstract int drain_tail (Gee.Collection recipient, int amount = -1); - public abstract bool offer_head (G element); - public abstract bool offer_tail (G element); - public abstract G peek_head (); - public abstract G peek_tail (); - public abstract G poll_head (); - public abstract G poll_tail (); - } - [CCode (cheader_filename = "gee.h")] - public interface Iterable : GLib.Object { - public abstract Gee.Iterator iterator (); - public abstract GLib.Type element_type { get; } - } - [CCode (cheader_filename = "gee.h")] - public interface Iterator : GLib.Object { - public abstract bool first (); - public abstract G @get (); - public abstract bool has_next (); - public abstract bool next (); - public abstract void remove (); - } - [CCode (cheader_filename = "gee.h")] - public interface List : Gee.Collection { - public static Gee.List empty (); - public abstract G first (); - public abstract G @get (int index); - public abstract int index_of (G item); - public abstract void insert (int index, G item); - public abstract void insert_all (int index, Gee.Collection collection); - public abstract G last (); - public abstract new Gee.ListIterator list_iterator (); - public abstract G remove_at (int index); - public abstract void @set (int index, G item); - public abstract Gee.List? slice (int start, int stop); - public abstract void sort (GLib.CompareFunc? compare_func = null); - public abstract Gee.List read_only_view { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public interface ListIterator : Gee.BidirIterator { - public abstract void add (G item); - public abstract int index (); - public abstract void insert (G item); - public abstract void @set (G item); - } - [CCode (cheader_filename = "gee.h")] - public interface Map : GLib.Object, Gee.Iterable> { - public abstract class Entry : GLib.Object { - public Entry (); - public abstract K key { get; } - public abstract V value { get; set; } - } - public abstract void clear (); - [Deprecated] - public abstract bool contains (K key); - [Deprecated] - public abstract bool contains_all (Gee.Map map); - public static Gee.Map empty (); - public abstract V @get (K key); - public abstract bool has (K key, V value); - public abstract bool has_all (Gee.Map map); - public abstract bool has_key (K key); - public abstract Gee.MapIterator map_iterator (); - [Deprecated] - public abstract bool remove (K key, out V value = null); - [Deprecated] - public abstract bool remove_all (Gee.Map map); - public abstract void @set (K key, V value); - public abstract void set_all (Gee.Map map); - public abstract bool unset (K key, out V value = null); - public abstract bool unset_all (Gee.Map map); - public abstract Gee.Set> entries { owned get; } - public abstract bool is_empty { get; } - public abstract GLib.Type key_type { get; } - public abstract Gee.Set keys { owned get; } - public abstract Gee.Map read_only_view { owned get; } - public abstract int size { get; } - public abstract GLib.Type value_type { get; } - public abstract Gee.Collection values { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public interface MapIterator : GLib.Object { - public abstract bool first (); - public abstract K get_key (); - public abstract V get_value (); - public abstract bool has_next (); - public abstract bool next (); - public abstract void set_value (V value); - public abstract void unset (); - } - [CCode (cheader_filename = "gee.h")] - public interface MultiMap : GLib.Object { - public abstract void clear (); - public abstract bool contains (K key); - public abstract Gee.Collection @get (K key); - public abstract Gee.MultiSet get_all_keys (); - public abstract Gee.Set get_keys (); - public abstract Gee.Collection get_values (); - public abstract bool remove (K key, V value); - public abstract bool remove_all (K key); - public abstract void @set (K key, V value); - public abstract int size { get; } - } - [CCode (cheader_filename = "gee.h")] - public interface MultiSet : Gee.Collection { - public abstract int count (G item); - } - [CCode (cheader_filename = "gee.h")] - public interface Queue : Gee.Collection { - public const int UNBOUNDED_CAPACITY; - public abstract int drain (Gee.Collection recipient, int amount = -1); - public abstract bool offer (G element); - public abstract G peek (); - public abstract G poll (); - public abstract int capacity { get; } - public abstract bool is_full { get; } - public abstract int remaining_capacity { get; } - } - [CCode (cheader_filename = "gee.h")] - public interface Set : Gee.Collection { - public static Gee.Set empty (); - public abstract Gee.Set read_only_view { owned get; } - } - [CCode (cheader_filename = "gee.h")] - public interface SortedSet : Gee.Set { - public abstract Gee.BidirIterator bidir_iterator (); - public abstract G ceil (G element); - public abstract G first (); - public abstract G floor (G element); - public abstract Gee.SortedSet head_set (G before); - public abstract G higher (G element); - public abstract Gee.BidirIterator? iterator_at (G element); - public abstract G last (); - public abstract G lower (G element); - public abstract Gee.SortedSet sub_set (G from, G to); - public abstract Gee.SortedSet tail_set (G after); - } - [CCode (cheader_filename = "gee.h")] - public static int direct_compare (void* _val1, void* _val2); -} diff -Nru deepin-terminal-3.0.3+ds/vapi/vte-2.91.vapi deepin-terminal-3.0.7/vapi/vte-2.91.vapi --- deepin-terminal-3.0.3+ds/vapi/vte-2.91.vapi 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/vapi/vte-2.91.vapi 1970-01-01 00:00:00.000000000 +0000 @@ -1,239 +0,0 @@ -/* vte-2.91.vapi generated by vapigen-0.30, do not modify. */ - -[CCode (cprefix = "Vte", gir_namespace = "Vte", gir_version = "2.91", lower_case_cprefix = "vte_")] -namespace Vte { - [CCode (cheader_filename = "vte/vte.h", type_id = "vte_pty_get_type ()")] - public class Pty : GLib.Object, GLib.Initable { - [CCode (has_construct_function = false)] - protected Pty (); - public void child_setup (); - [Version (deprecated = true, deprecated_since = "0.42", replacement = "")] - public void close (); - [CCode (has_construct_function = false)] - public Pty.foreign_sync (owned int fd, GLib.Cancellable? cancellable = null) throws GLib.Error; - public int get_fd (); - public bool get_size (out int rows, out int columns) throws GLib.Error; - public bool set_size (int rows, int columns) throws GLib.Error; - public bool set_utf8 (bool utf8) throws GLib.Error; - [CCode (has_construct_function = false)] - public Pty.sync (Vte.PtyFlags flags, GLib.Cancellable? cancellable = null) throws GLib.Error; - public int fd { get; construct; } - [NoAccessorMethod] - public Vte.PtyFlags flags { get; construct; } - } - [CCode (cheader_filename = "vte/vte.h", type_id = "vte_terminal_get_type ()")] - public class Terminal : Gtk.Widget, Atk.Implementor, Gtk.Buildable, Gtk.Scrollable { - [CCode (has_construct_function = false, type = "GtkWidget*")] - public Terminal (); - public void copy_primary (); - public bool event_check_gregex_simple (Gdk.Event event, [CCode (array_length_cname = "n_regexes", array_length_pos = 2.5, array_length_type = "gsize")] GLib.Regex[] regexes, GLib.RegexMatchFlags match_flags, [CCode (array_length_cname = "n_regexes", array_length_pos = 2.5, array_length_type = "gsize")] out unowned string[] matches); - public void feed ([CCode (array_length_cname = "length", array_length_pos = 1.1, array_length_type = "gssize")] uint8[] data); - public void feed_child (string text, ssize_t length); - public void feed_child_binary (uint8 data, size_t length); - public bool get_allow_bold (); - public bool get_audible_bell (); - public long get_char_height (); - public long get_char_width (); - public int get_cjk_ambiguous_width (); - public long get_column_count (); - public unowned string get_current_directory_uri (); - public unowned string get_current_file_uri (); - public Vte.CursorBlinkMode get_cursor_blink_mode (); - public void get_cursor_position (out long column, out long row); - public Vte.CursorShape get_cursor_shape (); - public unowned string get_encoding (); - public unowned Pango.FontDescription get_font (); - public double get_font_scale (); - public void get_geometry_hints (out Gdk.Geometry hints, int min_rows, int min_columns); - public bool get_has_selection (); - public unowned string get_icon_title (); - public bool get_input_enabled (); - public bool get_mouse_autohide (); - public unowned Vte.Pty get_pty (); - public bool get_rewrap_on_resize (); - public long get_row_count (); - public string get_text ([CCode (delegate_target_pos = 1.5)] Vte.SelectionFunc? is_selected, out GLib.Array attributes); - public string get_text_include_trailing_spaces ([CCode (delegate_target_pos = 1.5)] Vte.SelectionFunc? is_selected, out GLib.Array attributes); - public string get_text_range (long start_row, long start_col, long end_row, long end_col, [CCode (delegate_target_pos = 5.5)] Vte.SelectionFunc? is_selected, out GLib.Array attributes); - public unowned string get_window_title (); - public unowned string get_word_char_exceptions (); - public int match_add_gregex (GLib.Regex gregex, GLib.RegexMatchFlags gflags); - [Version (deprecated = true, deprecated_since = "0.44", replacement = "")] - public string match_check (long column, long row, out int tag); - public string match_check_event (Gdk.Event event, out int tag); - public void match_remove (int tag); - public void match_remove_all (); - [Version (deprecated = true, deprecated_since = "0.40", replacement = "")] - public void match_set_cursor (int tag, Gdk.Cursor? cursor); - public void match_set_cursor_name (int tag, string cursor_name); - public void match_set_cursor_type (int tag, Gdk.CursorType cursor_type); - public void paste_primary (); - public Vte.Pty pty_new_sync (Vte.PtyFlags flags, GLib.Cancellable? cancellable = null) throws GLib.Error; - public void reset (bool clear_tabstops, bool clear_history); - public bool search_find_next (); - public bool search_find_previous (); - public unowned GLib.Regex search_get_gregex (); - public bool search_get_wrap_around (); - public void search_set_gregex (GLib.Regex? gregex, GLib.RegexMatchFlags gflags); - public void search_set_wrap_around (bool wrap_around); - public void select_all (); - public void set_allow_bold (bool allow_bold); - public void set_audible_bell (bool is_audible); - public void set_backspace_binding (Vte.EraseBinding binding); - public void set_cjk_ambiguous_width (int width); - public void set_color_background (Gdk.RGBA background); - public void set_color_bold (Gdk.RGBA? bold); - public void set_color_cursor (Gdk.RGBA? cursor_background); - public void set_color_cursor_foreground (Gdk.RGBA? cursor_foreground); - public void set_color_foreground (Gdk.RGBA foreground); - public void set_color_highlight (Gdk.RGBA? highlight_background); - public void set_color_highlight_foreground (Gdk.RGBA? highlight_foreground); - public void set_colors (Gdk.RGBA? foreground, Gdk.RGBA? background, [CCode (array_length_cname = "palette_size", array_length_pos = 3.1, array_length_type = "gsize")] Gdk.RGBA[]? palette); - public void set_cursor_blink_mode (Vte.CursorBlinkMode mode); - public void set_cursor_shape (Vte.CursorShape shape); - public void set_default_colors (); - public void set_delete_binding (Vte.EraseBinding binding); - public bool set_encoding (string? codeset) throws GLib.Error; - public void set_font (Pango.FontDescription? font_desc); - public void set_font_scale (double scale); - public void set_geometry_hints_for_window (Gtk.Window window); - public void set_input_enabled (bool enabled); - public void set_mouse_autohide (bool setting); - public void set_pty (Vte.Pty? pty); - public void set_rewrap_on_resize (bool rewrap); - public void set_scroll_on_keystroke (bool scroll); - public void set_scroll_on_output (bool scroll); - public void set_scrollback_lines (long lines); - public void set_size (long columns, long rows); - public void set_word_char_exceptions (string exceptions); - public bool spawn_sync (Vte.PtyFlags pty_flags, string? working_directory, [CCode (array_length = false, array_null_terminated = true)] string[] argv, [CCode (array_length = false, array_null_terminated = true)] string[]? envv, GLib.SpawnFlags spawn_flags, [CCode (delegate_target_pos = 6.5)] GLib.SpawnChildSetupFunc? child_setup, out GLib.Pid child_pid, GLib.Cancellable? cancellable = null) throws GLib.Error; - public void unselect_all (); - public void watch_child (GLib.Pid child_pid); - public bool write_contents_sync (GLib.OutputStream stream, Vte.WriteFlags flags, GLib.Cancellable? cancellable = null) throws GLib.Error; - public bool allow_bold { get; set; } - public bool audible_bell { get; set; } - [NoAccessorMethod] - public Vte.EraseBinding backspace_binding { get; set; } - public int cjk_ambiguous_width { get; set; } - public string current_directory_uri { get; } - public string current_file_uri { get; } - public Vte.CursorBlinkMode cursor_blink_mode { get; set; } - public Vte.CursorShape cursor_shape { get; set; } - [NoAccessorMethod] - public Vte.EraseBinding delete_binding { get; set; } - [NoAccessorMethod] - public string encoding { owned get; set; } - [NoAccessorMethod] - public Pango.FontDescription font_desc { owned get; set; } - public double font_scale { get; set; } - public string icon_title { get; } - public bool input_enabled { get; set; } - [NoAccessorMethod] - public bool pointer_autohide { get; set; } - public Vte.Pty pty { get; set; } - public bool rewrap_on_resize { get; set; } - [NoAccessorMethod] - public bool scroll_on_keystroke { get; set; } - [NoAccessorMethod] - public bool scroll_on_output { get; set; } - [NoAccessorMethod] - public uint scrollback_lines { get; set; } - public string window_title { get; } - public string word_char_exceptions { get; } - public virtual signal void bell (); - public virtual signal void char_size_changed (uint char_width, uint char_height); - public virtual signal void child_exited (int status); - public virtual signal void commit (string text, uint size); - public virtual signal void contents_changed (); - [HasEmitter] - public virtual signal void copy_clipboard (); - public signal void current_directory_uri_changed (); - public signal void current_file_uri_changed (); - public virtual signal void cursor_moved (); - public virtual signal void decrease_font_size (); - public virtual signal void deiconify_window (); - public virtual signal void encoding_changed (); - public virtual signal void eof (); - public virtual signal void icon_title_changed (); - public virtual signal void iconify_window (); - public virtual signal void increase_font_size (); - public virtual signal void lower_window (); - public virtual signal void maximize_window (); - public virtual signal void move_window (uint x, uint y); - [HasEmitter] - public virtual signal void paste_clipboard (); - public virtual signal void raise_window (); - public virtual signal void refresh_window (); - public virtual signal void resize_window (uint width, uint height); - public virtual signal void restore_window (); - public virtual signal void selection_changed (); - public virtual signal void text_deleted (); - public virtual signal void text_inserted (); - public virtual signal void text_modified (); - public virtual signal void text_scrolled (int delta); - public virtual signal void window_title_changed (); - } - [CCode (cheader_filename = "vte/vte.h", has_type_id = false)] - public struct CharAttributes { - } - [CCode (cheader_filename = "vte/vte.h", cprefix = "VTE_CURSOR_BLINK_", type_id = "vte_cursor_blink_mode_get_type ()")] - public enum CursorBlinkMode { - SYSTEM, - ON, - OFF - } - [CCode (cheader_filename = "vte/vte.h", cprefix = "VTE_CURSOR_SHAPE_", type_id = "vte_cursor_shape_get_type ()")] - public enum CursorShape { - BLOCK, - IBEAM, - UNDERLINE - } - [CCode (cheader_filename = "vte/vte.h", cprefix = "VTE_ERASE_", type_id = "vte_erase_binding_get_type ()")] - public enum EraseBinding { - AUTO, - ASCII_BACKSPACE, - ASCII_DELETE, - DELETE_SEQUENCE, - TTY - } - [CCode (cheader_filename = "vte/vte.h", cprefix = "VTE_PTY_", type_id = "vte_pty_flags_get_type ()")] - [Flags] - public enum PtyFlags { - NO_LASTLOG, - NO_UTMP, - NO_WTMP, - NO_HELPER, - NO_FALLBACK, - DEFAULT - } - [CCode (cheader_filename = "vte/vte.h", cprefix = "VTE_WRITE_", type_id = "vte_write_flags_get_type ()")] - public enum WriteFlags { - DEFAULT - } - [CCode (cheader_filename = "vte/vte.h", cprefix = "VTE_PTY_ERROR_")] - public errordomain PtyError { - PTY_HELPER_FAILED, - PTY98_FAILED; - public static GLib.Quark quark (); - } - [CCode (cheader_filename = "vte/vte.h", instance_pos = 3.9)] - public delegate bool SelectionFunc (Vte.Terminal terminal, long column, long row); - [CCode (cheader_filename = "vte/vte.h", cname = "VTE_MAJOR_VERSION")] - public const int MAJOR_VERSION; - [CCode (cheader_filename = "vte/vte.h", cname = "VTE_MICRO_VERSION")] - public const int MICRO_VERSION; - [CCode (cheader_filename = "vte/vte.h", cname = "VTE_MINOR_VERSION")] - public const int MINOR_VERSION; - [CCode (cheader_filename = "vte/vte.h", cname = "VTE_SPAWN_NO_PARENT_ENVV")] - public const int SPAWN_NO_PARENT_ENVV; - [CCode (cheader_filename = "vte/vte.h")] - public static unowned string get_features (); - [CCode (cheader_filename = "vte/vte.h")] - public static uint get_major_version (); - [CCode (cheader_filename = "vte/vte.h")] - public static uint get_micro_version (); - [CCode (cheader_filename = "vte/vte.h")] - public static uint get_minor_version (); - [CCode (cheader_filename = "vte/vte.h")] - public static string get_user_shell (); -} diff -Nru deepin-terminal-3.0.3+ds/vapi/xcb.vapi deepin-terminal-3.0.7/vapi/xcb.vapi --- deepin-terminal-3.0.3+ds/vapi/xcb.vapi 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/vapi/xcb.vapi 1970-01-01 00:00:00.000000000 +0000 @@ -1,2678 +0,0 @@ -/* xcb.vapi - * - * Copyright (C) 2009 Jürg Billeter - * Copyright (C) 2013 Sergio Costas - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Authors: - * Jürg Billeter - * Sergio Costas - */ - -[CCode (cprefix = "xcb_", cheader_filename = "xcb/xcb.h,xcb/xproto.h")] -namespace Xcb { - [Compact] - [CCode (cname = "xcb_connection_t", cprefix = "xcb_", ref_function = "", unref_function = "xcb_disconnect")] - public class Connection { - [CCode (cname = "xcb_connect")] - public Connection (string? display = null, out int screen = null); - [CCode (cname = "xcb_connection_has_error")] - public int has_error (); - - public void flush (); - public uint32 generate_id (); - public Setup get_setup (); - public GenericEvent wait_for_event (); - public GenericEvent poll_for_event (); - public int get_file_descriptor (); - public Xcb.GenericError? request_check (Xcb.VoidCookie cookie); - - public VoidCookie create_window_checked (uint8 depth, Window window, Window parent, int16 x, int16 y, uint16 width, uint16 height, uint16 border_width, uint16 _class, VisualID visual, CW value_mask, [CCode (array_length = false)] uint32[]? value_list); - public VoidCookie create_window (uint8 depth, Window window, Window parent, int16 x, int16 y, uint16 width, uint16 height, uint16 border_width, uint16 _class, VisualID visual, CW value_mask, [CCode (array_length = false)] uint32[]? value_list); - - public VoidCookie change_window_attributes_checked (Window window, CW value_mask, [CCode (array_length = false)] uint32[]? value_list); - public VoidCookie change_window_attributes (Window window, CW value_mask, [CCode (array_length = false)] uint32[]? value_list); - - public GetWindowAttributesCookie get_window_attributes (Window window); - public GetWindowAttributesCookie get_window_attributes_unchecked (Window window); - public GetWindowAttributesReply? get_window_attributes_reply (GetWindowAttributesCookie cookie, out GenericError? e = null); - - public VoidCookie destroy_window_checked (Window window); - public VoidCookie destroy_window (Window window); - - public VoidCookie destroy_subwindows_checked (Window window); - public VoidCookie destroy_subwindows (Window window); - - public VoidCookie change_save_set_checked (SetMode mode, Window window); - public VoidCookie change_save_set (SetMode mode, Window window); - - public VoidCookie reparent_window_checked (Window window, Window parent, uint16 x, uint16 y); - public VoidCookie reparent_window (Window window, Window parent, uint16 x, uint16 y); - - public VoidCookie map_window_checked (Window window); - public VoidCookie map_window (Window window); - - public VoidCookie map_subwindows_checked (Window window); - public VoidCookie map_subwindows (Window window); - - public VoidCookie unmap_window_checked (Window window); - public VoidCookie unmap_window (Window window); - - public VoidCookie unmap_subwindows_checked (Window window); - public VoidCookie unmap_subwindows (Window window); - - public VoidCookie configure_window_checked (Window window, ConfigWindow value_mask, [CCode (array_length = false)] uint32[] value_list); - public VoidCookie configure_window (Window window, ConfigWindow value_mask, [CCode (array_length = false)] uint32[] value_list); - - public VoidCookie circulate_window_checked (Circulate direction, Window window); - public VoidCookie circulate_window (Circulate direction, Window window); - - public GetGeometryCookie get_geometry (Drawable drawable); - public GetGeometryCookie get_geometry_unchecked (Drawable drawable); - public GetGeometryReply? get_geometry_reply (GetGeometryCookie cookie, out GenericError? e = null); - - public QueryTreeCookie query_tree (Window window); - public QueryTreeCookie query_tree_unchecked (Window window); - public QueryTreeReply? query_tree_reply (QueryTreeCookie cookie, out GenericError? e = null); - - [CCode (cname = "xcb_intern_atom")] - private InternAtomCookie vala_intern_atom (bool only_if_exists, uint16 len, string name); - [CCode (cname = "vala_xcb_intern_atom")] - public InternAtomCookie intern_atom (bool only_if_exists, string name) { - return this.vala_intern_atom (only_if_exists, (uint16) name.length, name); - } - [CCode (cname = "xcb_intern_atom_unchecked")] - private InternAtomCookie vala_intern_atom_unchecked (bool only_if_exists, uint16 len, string name); - [CCode (cname = "vala_xcb_intern_atom_unchecked")] - public InternAtomCookie intern_atom_unchecked (bool only_if_exists, string name) { - return this.vala_intern_atom (only_if_exists, (uint16) name.length, name); - } - public InternAtomReply? intern_atom_reply (InternAtomCookie cookie, out GenericError? e = null); - - public GetAtomNameCookie get_atom_name (Atom atom); - public GetAtomNameCookie get_atom_name_unchecked (Atom atom); - public GetAtomNameReply? get_atom_name_reply (GetAtomNameCookie cookie, out GenericError? e = null); - - [CCode (cname = "xcb_change_property")] - private VoidCookie vala_change_property (PropMode mode, Window window, Atom property, Atom type, uint8 format, uint32 len, void *data); - [CCode (cname = "vala_xcb_change_property")] - public VoidCookie change_property_uint8 (PropMode mode, Window window, Atom property, Atom type, uint32 len, uint8 *data) { - return this.vala_change_property (mode, window, property, type, 8, len, (void *)data); - } - public VoidCookie change_property_uint16 (PropMode mode, Window window, Atom property, Atom type, uint32 len, uint16 *data) { - return this.vala_change_property (mode, window, property, type, 16, len, (void *)data); - } - public VoidCookie change_property_uint32 (PropMode mode, Window window, Atom property, Atom type, uint32 len, uint32 *data) { - return this.vala_change_property (mode, window, property, type, 32, len, (void *)data); - } - public VoidCookie change_property_atom (PropMode mode, Window window, Atom property, Atom type, uint32 len, Atom *data) { - return this.vala_change_property (mode, window, property, type, 32, len, (void *)data); - } - public VoidCookie change_property_string (PropMode mode, Window window, Atom property, Atom type, string data) { - return this.vala_change_property (mode, window, property, type, 8, data.length, (void *)data.data); - } - - [CCode (cname = "xcb_change_property_checked")] - private VoidCookie vala_change_property_checked (PropMode mode, Window window, Atom property, Atom type, uint8 format, uint32 len, void *data); - [CCode (cname = "vala_xcb_change_property_checked")] - public VoidCookie change_property_checked_uint8 (PropMode mode, Window window, Atom property, Atom type, uint32 len, uint8 *data) { - return this.vala_change_property (mode, window, property, type, 8, len, (void *) data); - } - public VoidCookie change_property_checked_uint16 (PropMode mode, Window window, Atom property, Atom type, uint32 len, uint16 *data) { - return this.vala_change_property (mode, window, property, type, 16, len, (void *) data); - } - public VoidCookie change_property_checked_uint32 (PropMode mode, Window window, Atom property, Atom type, uint32 len, uint32 *data) { - return this.vala_change_property (mode, window, property, type, 32, len, (void *) data); - } - public VoidCookie change_property_checked_atom (PropMode mode, Window window, Atom property, Atom type, uint32 len, Atom *data) { - return this.vala_change_property (mode, window, property, type, 32, len, (void *) data); - } - public VoidCookie change_property_checked_string (PropMode mode, Window window, Atom property, Atom type, string data) { - return this.vala_change_property (mode, window, property, type, 8, data.length, (void *) data.data); - } - - public VoidCookie delete_property_checked (Window window, Atom property); - public VoidCookie delete_property (Window window, Atom property); - - public GetPropertyCookie get_property (bool _delete, Window window, Atom property, Atom type, uint32 long_offset, uint32 long_length); - public GetPropertyCookie get_property_unchecked (bool _delete, Window window, Atom property, Atom type, uint32 long_offset, uint32 long_length); - public GetPropertyReply? get_property_reply (GetPropertyCookie cookie, out GenericError? e = null); - - public ListPropertiesCookie list_properties (Window window); - public ListPropertiesCookie list_properties_unchecked (Window window); - public ListPropertiesReply? list_properties_reply (ListPropertiesCookie cookie, out GenericError? e = null); - - public VoidCookie set_selection_owner_checked (Window owner, Atom selection, Timestamp time); - public VoidCookie set_selection_owner (Window owner, Atom selection, Timestamp time); - - public GetSelectionOwnerCookie get_selection_owner (Atom selection); - public GetSelectionOwnerCookie get_selection_owner_unchecked (Atom selection); - public GetSelectionOwnerReply? get_selection_owner_reply (GetSelectionOwnerCookie cookie, out GenericError? e = null); - - public VoidCookie convert_selection_checked (Window requestor, Atom selection, Atom target, Atom property, Timestamp time); - public VoidCookie convert_selection (Window requestor, Atom selection, Atom target, Atom property, Timestamp time); - - //send_event - - public GrabPointerCookie grab_pointer (bool owner_events, Window grab_window, EventMask event_mask, GrabMode pointer_mode, GrabMode keyboard_mode, Window confine_to, Cursor cursor, Timestamp time); - public GrabPointerCookie grab_pointer_unchecked (bool owner_events, Window grab_window, EventMask event_mask, GrabMode pointer_mode, GrabMode keyboard_mode, Window confine_to, Cursor cursor, Timestamp time); - public GrabPointerReply? grab_pointer_reply (GrabPointerCookie cookie, out GenericError? e = null); - - public VoidCookie ungrab_pointer_checked (Timestamp time); - public VoidCookie ungrab_pointer (Timestamp time); - - public VoidCookie grab_button_checked (bool owner_events, Window grab_window, EventMask event_mask, GrabMode pointer_mode, GrabMode keyboard_mode, Window confine_to, Cursor cursor, uint8 button, uint16 modifiers); - public VoidCookie grab_button (bool owner_events, Window grab_window, EventMask event_mask, GrabMode pointer_mode, GrabMode keyboard_mode, Window confine_to, Cursor cursor, uint8 button, uint16 modifiers); - - public VoidCookie ungrab_button_checked (uint8 button, Window grab_window, uint16 modifiers); - public VoidCookie ungrab_button (uint8 button, Window grab_window, uint16 modifiers); - - public VoidCookie change_active_pointer_grab_checked (Cursor cursor, Timestamp time, EventMask event_mask); - public VoidCookie change_active_pointer_grab (Cursor cursor, Timestamp time, EventMask event_mask); - - public GrabKeyboardCookie grab_keyboard (bool owner_events, Window grab_window, Timestamp time, GrabMode pointer_mode, GrabMode keyboard_mode); - public GrabKeyboardCookie grab_keyboard_unchecked (bool owner_events, Window grab_window, Timestamp time, GrabMode pointer_mode, GrabMode keyboard_mode); - public GrabKeyboardReply? grab_keyboard_reply (GrabKeyboardCookie cookie, out GenericError? e = null); - - public VoidCookie ungrab_keyboard_checked (Timestamp time); - public VoidCookie ungrab_keyboard (Timestamp time); - - public VoidCookie grab_key_checked (bool owner_events, Window grab_window, uint16 modifiers, Keycode key, GrabMode pointer_mode, GrabMode keyboard_mode); - public VoidCookie grab_key (bool owner_events, Window grab_window, uint16 modifiers, Keycode key, GrabMode pointer_mode, GrabMode keyboard_mode); - - public VoidCookie ungrab_key_checked (Keycode key, Window grab_window, uint16 modifiers); - public VoidCookie ungrab_key (Keycode key, Window grab_window, uint16 modifiers); - - public VoidCookie allow_events_checked (Allow mode, Timestamp time); - public VoidCookie allow_events (Allow mode, Timestamp time); - - public VoidCookie grab_server_checked (); - public VoidCookie grab_server (); - - public VoidCookie ungrab_server_checked (); - public VoidCookie ungrab_server (); - - public QueryPointerCookie query_pointer (Window window); - public QueryPointerCookie query_pointer_unchecked (Window window); - public QueryPointerReply? query_pointer_reply (QueryPointerCookie cookie, out GenericError? e = null); - - public GetMotionEventsCookie get_motion_events (Window window, Timestamp start, Timestamp stop); - public GetMotionEventsCookie get_motion_events_unchecked (Window window, Timestamp start, Timestamp stop); - public GetMotionEventsReply? get_motion_events_reply (GetMotionEventsCookie cookie, out GenericError? e = null); - - public TranslateCoordinatesCookie translate_coordinates (Window src_window, Window dst_window, int16 src_x, int16 src_y); - public TranslateCoordinatesCookie translate_coordinates_unchecked (Window src_window, Window dst_window, int16 src_x, int16 src_y); - public TranslateCoordinatesReply? translate_coordinates_reply (TranslateCoordinatesCookie cookie, out GenericError? e = null); - - public VoidCookie warp_pointer_checked (Window src_window, Window dst_window, int16 src_x, int16 src_y, uint16 src_width, uint16 src_height, int16 dst_x, int16 dst_y); - public VoidCookie warp_pointer (Window src_window, Window dst_window, int16 src_x, int16 src_y, uint16 src_width, uint16 src_height, int16 dst_x, int16 dst_y); - - public VoidCookie set_input_focus_checked (InputFocus revert_to, Window focus, Timestamp time); - public VoidCookie set_input_focus (InputFocus revert_to, Window focus, Timestamp time); - - public GetInputFocusCookie get_input_focus (); - public GetInputFocusCookie get_input_focus_unchecked (); - public GetInputFocusReply? get_input_focus_reply (GetInputFocusCookie cookie, out GenericError? e = null); - - public QueryKeymapCookie query_keymap (); - public QueryKeymapCookie query_keymap_unchecked (); - public QueryKeymapReply? query_keymap_reply (QueryKeymapCookie cookie, out GenericError? e = null); - - [CCode (cname = "xcb_open_font_checked")] - private VoidCookie vala_open_font_checked (Font fid, uint16 name_len, string name); - [CCode (cname = "vala_xcb_open_font_checked")] - public VoidCookie open_font_checked (Font fid, string name) { - return this.vala_open_font_checked (fid, (uint16) name.length, name); - } - [CCode (cname = "xcb_open_font")] - private VoidCookie vala_open_font (Font fid, uint16 name_len, string name); - [CCode (cname = "vala_xcb_open_font")] - public VoidCookie open_font (Font fid, string name) { - return this.vala_open_font (fid, (uint16) name.length, name); - } - - public VoidCookie close_font_checked (Font fid); - public VoidCookie close_font (Font fid); - - public QueryFontCookie query_font (Fontable font); - public QueryFontCookie query_font_unchecked (Fontable font); - public QueryFontReply? query_font_reply (QueryFontCookie cookie, out GenericError? e = null); - - /*[CCode (cname = "xcb_query_text_extents")] - private QueryTextExtentsCookie vala_query_text_extents (Fontable font, uint32 string_len, Char2b* s); - [CCode (cname = "vala_xcb_query_text_extents")] - public QueryTextExtentsCookie query_text_extents (Fontable font, uint16[] s) { - this.vala_query_text_extents (font, s.length, s); - } - [CCode (cname = "xcb_query_text_extents_unchecked")] - private QueryTextExtentsCookie vala_query_text_extents_unchecked (Fontable font, uint32 string_len, Char2b* s); - [CCode (cname = "vala_xcb_query_text_extents_unchecked")] - public QueryTextExtentsCookie query_text_extents_unchecked (Fontable font, uint16[] s) { // FIXME: How to handle Char2b? - this.vala_query_text_extents_unchecked (font, s.length, s); - } - public QueryTextExtentsReply? query_text_extents_reply (QueryTextExtentsCookie cookie, out GenericError? e = null);*/ - - [CCode (cname = "xcb_list_fonts")] - private ListFontsCookie vala_list_fonts (uint16 max_names, uint16 pattern_len, string pattern); - [CCode (cname = "vala_xcb_list_fonts")] - public ListFontsCookie list_fonts (uint16 max_names, string pattern) { - return this.vala_list_fonts (max_names, (uint16) pattern.length, pattern); - } - [CCode (cname = "xcb_list_fonts_unchecked")] - private ListFontsCookie vala_list_fonts_unchecked (uint16 max_names, uint16 pattern_len, string pattern); - [CCode (cname = "vala_xcb_list_fonts_unchecked")] - public ListFontsCookie list_fonts_unchecked (uint16 max_names, string pattern) { - return this.vala_list_fonts_unchecked (max_names, (uint16) pattern.length, pattern); - } - public ListFontsReply? list_fonts_reply (ListFontsCookie cookie, out GenericError? e = null); - - [CCode (cname = "xcb_list_fonts_with_info")] - private ListFontsWithInfoCookie vala_list_fonts_with_info (uint16 max_names, uint16 pattern_len, string pattern); - [CCode (cname = "vala_xcb_list_fonts_with_info")] - public ListFontsWithInfoCookie list_fonts_with_info (uint16 max_names, string pattern) { - return this.vala_list_fonts_with_info (max_names, (uint16) pattern.length, pattern); - } - [CCode (cname = "xcb_list_fonts_with_info_unchecked")] - private ListFontsWithInfoCookie vala_list_fonts_with_info_unchecked (uint16 max_names, uint16 pattern_len, string pattern); - [CCode (cname = "vala_xcb_list_fonts_with_info_unchecked")] - public ListFontsWithInfoCookie list_fonts_with_info_unchecked (uint16 max_names, string pattern) { - return this.vala_list_fonts_with_info_unchecked (max_names, (uint16) pattern.length, pattern); - } - public ListFontsWithInfoReply? list_fonts_with_info_reply (ListFontsWithInfoCookie cookie, out GenericError? e = null); - - //set_font_path - - public GetFontPathCookie get_font_path (); - public GetFontPathCookie get_font_path_unchecked (); - public GetFontPathReply? get_font_path_reply (GetFontPathCookie cookie, out GenericError? e = null); - - public VoidCookie create_pixmap_checked (uint8 depth, Pixmap pid, Drawable drawable, uint16 width, uint16 height); - public VoidCookie create_pixmap (uint8 depth, Pixmap pid, Drawable drawable, uint16 width, uint16 height); - - public VoidCookie free_pixmap_checked (Pixmap pid); - public VoidCookie free_pixmap (Pixmap pid); - - public VoidCookie create_gc_checked (GContext cid, Drawable drawable, GC value_mask = 0, [CCode (array_length = false)] uint32[]? value_list = null); - public VoidCookie create_gc (GContext cid, Drawable drawable, GC value_mask = 0, [CCode (array_length = false)] uint32[]? value_list = null); - - public VoidCookie change_gc_checked (GContext gc, GC value_mask, [CCode (array_length = false)] uint32[]? value_list); - public VoidCookie change_gc (GContext gc, GC value_mask, [CCode (array_length = false)] uint32[]? value_list); - - public VoidCookie copy_gc_checked (GContext src_gc, GContext dst_gc, GC value_mask); - public VoidCookie copy_gc (GContext src_gc, GContext dst_gc, GC value_mask); - - public VoidCookie set_dashes_checked (GContext gc, uint16 dash_offset, [CCode (array_length_pos = 2.9, array_length_type = "uint16_t")] uint8[] dashes); - public VoidCookie set_dashes (GContext gc, uint16 dash_offset, [CCode (array_length_pos = 2.9, array_length_type = "uint16_t")] uint8[] dashes); - - public VoidCookie set_clip_rectangles_checked (ClipOrdering ordering, GContext gc, int16 clip_x_origin, int16 clip_y_origin, [CCode (array_length_pos = 4.9, array_length_type = "uint32_t")] Rectangle[] rectangles); - public VoidCookie set_clip_rectangles (ClipOrdering ordering, GContext gc, int16 clip_x_origin, int16 clip_y_origin, [CCode (array_length_pos = 4.9, array_length_type = "uint32_t")] Rectangle[] rectangles); - - public VoidCookie free_gc_checked (GContext gc); - public VoidCookie free_gc (GContext gc); - - public VoidCookie clear_area_checked (bool exposures, Window window, int16 x, int16 y, uint16 width, uint16 height); - public VoidCookie clear_area (bool exposures, Window window, int16 x, int16 y, uint16 width, uint16 height); - - public VoidCookie copy_area_checked (Drawable src_drawable, Drawable dst_drawable, GContext gc, int16 src_x, int16 src_y, int16 dst_x, int16 dst_y, uint16 width, uint16 height); - public VoidCookie copy_area (Drawable src_drawable, Drawable dst_drawable, GContext gc, int16 src_x, int16 src_y, int16 dst_x, int16 dst_y, uint16 width, uint16 height); - - public VoidCookie copy_plane_checked (Drawable src_drawable, Drawable dst_drawable, GContext gc, int16 src_x, int16 src_y, int16 dst_x, int16 dst_y, uint16 width, uint16 height, uint32 bit_plane); - public VoidCookie copy_plane (Drawable src_drawable, Drawable dst_drawable, GContext gc, int16 src_x, int16 src_y, int16 dst_x, int16 dst_y, uint16 width, uint16 height, uint32 bit_plane); - - public VoidCookie poly_point_checked (CoordMode coordinate_mode, Drawable drawable, GContext gc, [CCode (array_length_pos = 3.9, array_length_type = "uint32_t")] Point[] points); - public VoidCookie poly_point (CoordMode coordinate_mode, Drawable drawable, GContext gc, [CCode (array_length_pos = 3.9, array_length_type = "uint32_t")] Point[] points); - - public VoidCookie poly_line_checked (CoordMode coordinate_mode, Drawable drawable, GContext gc, [CCode (array_length = false)] Point[] points); - public VoidCookie poly_line (CoordMode coordinate_mode, Drawable drawable, GContext gc, [CCode (array_length_pos = 3.9, array_length_type = "uint32_t")] Point[] points); - - public VoidCookie poly_segment_checked (Drawable drawable, GContext gc, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] Segment[] segments); - public VoidCookie poly_segment (Drawable drawable, GContext gc, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] Segment[] segments); - - public VoidCookie poly_rectangle_checked (Drawable drawable, GContext gc, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] Rectangle[] rectangles); - public VoidCookie poly_rectangle (Drawable drawable, GContext gc, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] Rectangle[] rectangles); - - public VoidCookie poly_arc_checked (Drawable drawable, GContext gc, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] Arc[] arcs); - public VoidCookie poly_arc (Drawable drawable, GContext gc, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] Arc[] arcs); - - public VoidCookie fill_poly_checked (Drawable drawable, GContext gc, PolyShape shape, CoordMode coordinate_mode, [CCode (array_length_pos = 4.9, array_length_type = "uint32_t")] Point[] points); - public VoidCookie fill_poly (Drawable drawable, GContext gc, PolyShape shape, CoordMode coordinate_mode, [CCode (array_length_pos = 4.9, array_length_type = "uint32_t")] Point[] points); - - public VoidCookie poly_fill_rectangle_checked (Drawable drawable, GContext gc, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] Rectangle[] rectangles); - public VoidCookie poly_fill_rectangle (Drawable drawable, GContext gc, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] Rectangle[] rectangles); - - public VoidCookie poly_fill_arc_checked (Drawable drawable, GContext gc, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] Arc[] arcs); - public VoidCookie poly_fill_arc (Drawable drawable, GContext gc, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] Arc[] arcs); - - public VoidCookie put_image_checked (ImageFormat format, Drawable drawable, GContext gc, uint16 width, uint16 height, int16 dst_x, int16 dst_y, uint8 left_pad, uint8 depth, [CCode (array_length_pos = 9.9, array_length_type = "uint32_t")] uint8[] data); - public VoidCookie put_image (ImageFormat format, Drawable drawable, GContext gc, uint16 width, uint16 height, int16 dst_x, int16 dst_y, uint8 left_pad, uint8 depth, [CCode (array_length_pos = 9.9, array_length_type = "uint32_t")] uint8[] data); - - public GetImageCookie get_image (ImageFormat format, Drawable drawable, int16 x, int16 y, uint16 width, uint16 height, uint32 plane_mask); - public GetImageCookie get_image_unchecked (ImageFormat format, Drawable drawable, int16 x, int16 y, uint16 width, uint16 height, uint32 plane_mask); - public GetImageReply? get_image_reply (GetImageCookie cookie, out GenericError? e = null); - - public VoidCookie poly_text_8_checked (Drawable drawable, GContext gc, int16 x, int16 y, [CCode (array_length_pos = 4.9, array_length_type = "uint32_t")] uint8[] items); - public VoidCookie poly_text_8 (Drawable drawable, GContext gc, int16 x, int16 y, [CCode (array_length_pos = 4.9, array_length_type = "uint32_t")] uint8[] items); - - public VoidCookie poly_text_16_checked (Drawable drawable, GContext gc, int16 x, int16 y, [CCode (array_length_pos = 4.9, array_length_type = "uint32_t")] uint8[] items); - public VoidCookie poly_text_16 (Drawable drawable, GContext gc, int16 x, int16 y, [CCode (array_length_pos = 4.9, array_length_type = "uint32_t")] uint8[] items); - - [CCode (cname = "xcb_image_text_8_checked")] - private VoidCookie vala_image_text_8_checked (uint8 string_len, Drawable drawable, GContext gc, int16 x, int16 y, string text); - [CCode (cname = "vala_xcb_image_text8_checked")] - public VoidCookie image_text_8_checked (Drawable drawable, GContext gc, int16 x, int16 y, string text) { - this.vala_image_text_8_checked ((uint8) text.length, drawable, gc, x, y, text); - } - [CCode (cname = "xcb_image_text_8")] - private VoidCookie vala_image_text_8 (uint8 string_len, Drawable drawable, GContext gc, int16 x, int16 y, string text); - [CCode (cname = "vala_xcb_image_text8")] - public VoidCookie image_text_8 (Drawable drawable, GContext gc, int16 x, int16 y, string text) { - this.vala_image_text_8 ((uint8) text.length, drawable, gc, x, y, text); - } - - //image_text_16 - - public VoidCookie create_colormap_checked (bool alloc, Colormap mid, Window window, VisualID visual); - public VoidCookie create_colormap (bool alloc, Colormap mid, Window window, VisualID visual); - - public VoidCookie free_colormap_checked (Colormap cmap); - public VoidCookie free_colormap (Colormap cmap); - - public VoidCookie copy_colormap_and_free_checked (Colormap mid, Colormap src_cmap); - public VoidCookie copy_colormap_and_free (Colormap mid, Colormap src_cmap); - - public VoidCookie install_colormap_checked (Colormap cmap); - public VoidCookie install_colormap (Colormap cmap); - - public VoidCookie uninstall_colormap_checked (Colormap cmap); - public VoidCookie uninstall_colormap (Colormap cmap); - - public ListInstalledColormapsCookie list_installed_colormaps (Window window); - public ListInstalledColormapsCookie list_installed_colormaps_unchecked (Window window); - public ListInstalledColormapsReply? list_installed_colormaps_reply (ListInstalledColormapsCookie cookie, out GenericError? e = null); - - public AllocColorCookie alloc_color (Colormap cmap, uint16 red, uint16 green, uint16 blue); - public AllocColorCookie alloc_color_unchecked (Colormap cmap, uint16 red, uint16 green, uint16 blue); - public AllocColorReply? alloc_color_reply (AllocColorCookie cookie, out GenericError? e = null); - - [CCode (cname = "xcb_alloc_named_color")] - private AllocNamedColorCookie vala_alloc_named_color (Colormap cmap, uint16 name_len, string name); - [CCode (cname = "vala_xcb_alloc_named_color")] - public AllocNamedColorCookie alloc_named_color (Colormap cmap, string name) { - this.vala_alloc_named_color (cmap, (uint16) name.length, name); - } - [CCode (cname = "xcb_alloc_named_color_unchecked")] - private AllocNamedColorCookie vala_alloc_named_color_unchecked (Colormap cmap, uint16 name_len, string name); - [CCode (cname = "vala_xcb_alloc_named_color_unchecked")] - public AllocNamedColorCookie alloc_named_color_unchecked (Colormap cmap, string name) { - this.vala_alloc_named_color_unchecked (cmap, (uint16) name.length, name); - } - public AllocNamedColorReply? alloc_named_color_reply (AllocNamedColorCookie cookie, out GenericError? e = null); - - public AllocColorCellsCookie alloc_color_cells (bool contiguous, Colormap cmap, uint16 colors, uint16 planes); - public AllocColorCellsCookie alloc_color_cells_unchecked (bool contiguous, Colormap cmap, uint16 colors, uint16 planes); - public AllocColorCellsReply? alloc_color_cells_reply (AllocColorCellsCookie cookie, out GenericError? e = null); - - public AllocColorPlanesCookie alloc_color_planes (bool contiguous, Colormap cmap, uint16 colors, uint16 reds, uint16 greens, uint16 blues); - public AllocColorPlanesCookie alloc_color_planes_unchecked (bool contiguous, Colormap cmap, uint16 colors, uint16 reds, uint16 greens, uint16 blues); - public AllocColorPlanesReply? alloc_color_planes_reply (AllocColorPlanesCookie cookie, out GenericError? e = null); - - public VoidCookie free_colors_checked (Colormap cmap, uint32 plane_mask, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] uint32[] pixels); - public VoidCookie free_colors (Colormap cmap, uint32 plane_mask, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] uint32[] pixels); - - public VoidCookie store_colors_checked (Colormap cmap, [CCode (array_length_pos = 1.9, array_length_type = "uint32_t")] Coloritem[] items); - public VoidCookie store_colors (Colormap cmap, [CCode (array_length_pos = 1.9, array_length_type = "uint32_t")] Coloritem[] items); - - [CCode (cname = "xcb_store_named_color_checked")] - private VoidCookie vala_store_named_color_checked (ColorFlag flags, Colormap cmap, uint32 pixel, uint16 name_len, string name); - [CCode (cname = "vala_xcb_store_named_color_checked")] - public VoidCookie store_named_color_checked (ColorFlag flags, Colormap cmap, uint32 pixel, string name) { - this.vala_store_named_color_checked (flags, cmap, pixel, (uint16) name.length, name); - } - [CCode (cname = "xcb_store_named_color")] - private VoidCookie vala_store_named_color (ColorFlag flags, Colormap cmap, uint32 pixel, uint16 name_len, string name); - [CCode (cname = "vala_xcb_store_named_color")] - public VoidCookie store_named_color (ColorFlag flags, Colormap cmap, uint32 pixel, string name) { - this.vala_store_named_color (flags, cmap, pixel, (uint16) name.length, name); - } - - public QueryColorsCookie query_colors (Colormap cmap, [CCode (array_length_pos = 1.9, array_length_type = "uint32_t")] uint32[] pixels); - public QueryColorsCookie query_colors_unchecked (Colormap cmap, [CCode (array_length_pos = 1.9, array_length_type = "uint32_t")] uint32[] pixels); - public QueryColorsReply? query_colors_reply (QueryColorsCookie cookie, out GenericError? e = null); - - [CCode (cname = "xcb_lookup_color")] - private LookupColorCookie vala_lookup_color (Colormap cmap, uint16 name_len, string name); - [CCode (cname = "vala_xcb_lookup_color")] - public LookupColorCookie lookup_color (Colormap cmap, string name) { - this.vala_lookup_color (cmap, (uint16) name.length, name); - } - [CCode (cname = "xcb_lookup_color_unchecked")] - private LookupColorCookie vala_lookup_color_unchecked (Colormap cmap, uint16 name_len, string name); - [CCode (cname = "vala_xcb_lookup_color_unchecked")] - public LookupColorCookie lookup_color_unchecked (Colormap cmap, string name) { - this.vala_lookup_color_unchecked (cmap, (uint16) name.length, name); - } - public LookupColorReply? lookup_color_reply (LookupColorCookie cookie, out GenericError? e = null); - - public VoidCookie create_cursor_checked (Cursor cid, Pixmap source, Pixmap mask, uint16 fore_red, uint16 fore_green, uint16 fore_blue, uint16 back_red, uint16 back_green, uint16 back_blue, uint16 x, uint16 y); - public VoidCookie create_cursor (Cursor cid, Pixmap source, Pixmap mask, uint16 fore_red, uint16 fore_green, uint16 fore_blue, uint16 back_red, uint16 back_green, uint16 back_blue, uint16 x, uint16 y); - - public VoidCookie create_glyph_cursor_checked (Cursor cid, Font source_font, Font mask_font, uint16 source_char, uint16 mask_char, uint16 fore_red, uint16 fore_green, uint16 fore_blue, uint16 back_red, uint16 back_green, uint16 back_blue); - public VoidCookie create_glyph_cursor (Cursor cid, Font source_font, Font mask_font, uint16 source_char, uint16 mask_char, uint16 fore_red, uint16 fore_green, uint16 fore_blue, uint16 back_red, uint16 back_green, uint16 back_blue); - - public VoidCookie free_cursor_checked (Cursor cursor); - public VoidCookie free_cursor (Cursor cursor); - - public VoidCookie recolor_cursor_checked (Cursor cursor, uint16 fore_red, uint16 fore_green, uint16 fore_blue, uint16 back_red, uint16 back_green, uint16 back_blue); - public VoidCookie recolor_cursor (Cursor cursor, uint16 fore_red, uint16 fore_green, uint16 fore_blue, uint16 back_red, uint16 back_green, uint16 back_blue); - - public QueryBestSizeCookie query_best_size (QueryShapeOf _class, Drawable drawable, uint16 width, uint16 height); - public QueryBestSizeCookie query_best_size_unchecked (QueryShapeOf _class, Drawable drawable, uint16 width, uint16 height); - public QueryBestSizeReply? query_best_size_reply (QueryBestSizeCookie cookie, out GenericError? e = null); - - [CCode (cname = "xcb_query_extension")] - private QueryExtensionCookie vala_query_extension (uint16 name_len, string name); - [CCode (cname = "vala_xcb_query_extension")] - public QueryExtensionCookie query_extension (string name) { - return this.vala_query_extension ((uint16) name.length, name); - } - [CCode (cname = "xcb_query_extension_unchecked")] - private QueryExtensionCookie vala_query_extension_unchecked (uint16 name_len, string name); - [CCode (cname = "vala_xcb_query_extension_unchecked")] - public QueryExtensionCookie query_extension_unchecked (string name) { - return this.vala_query_extension_unchecked ((uint16) name.length, name); - } - public QueryExtensionReply? query_extension_reply (QueryExtensionCookie cookie, out GenericError? e = null); - - public ListExtensionsCookie list_extensions (); - public ListExtensionsCookie list_extensions_unchecked (); - public ListExtensionsReply? list_extensions_reply (ListExtensionsCookie cookie, out GenericError? e = null); - - //change_keyboard_mapping - - //get_keyboard_mapping - - //change_keyboard_control - - //get_keyboard_control - - public VoidCookie bell_checked (int8 percent); - public VoidCookie bell (int8 percent); - - public VoidCookie change_pointer_control_checked (int16 acceleration_numerator, int16 acceleration_denominator, int16 threshold, bool do_acceleration, bool do_threshold); - public VoidCookie change_pointer_control (int16 acceleration_numerator, int16 acceleration_denominator, int16 threshold, bool do_acceleration, bool do_threshold); - - public GetPointerControlCookie get_pointer_control (); - public GetPointerControlCookie get_pointer_control_unchecked (); - public GetPointerControlReply? get_pointer_control_reply (GetPointerControlCookie cookie, out GenericError? e = null); - - public VoidCookie set_screen_saver_checked (int16 timeout, int16 interval, bool prefer_blanking, bool allow_exposures); - public VoidCookie set_screen_saver (int16 timeout, int16 interval, bool prefer_blanking, bool allow_exposures); - - public GetScreenSaverCookie get_screen_saver (); - public GetScreenSaverCookie get_screen_saver_unchecked (); - public GetScreenSaverReply? get_screen_saver_reply (GetScreenSaverCookie cookie, out GenericError? e = null); - - public VoidCookie change_hosts_checked (HostMode mode, Family family, [CCode (array_length_pos = 2.9, array_length_type = "uint16_t")] uint8[] address); - public VoidCookie change_hosts (HostMode mode, Family family, [CCode (array_length_pos = 2.9, array_length_type = "uint16_t")] uint8[] address); - - public ListHostsCookie list_hosts (); - public ListHostsCookie list_hosts_unchecked (); - public ListHostsReply? list_hosts_reply (ListHostsCookie cookie, out GenericError? e = null); - - public VoidCookie set_access_control_checked (AccessControl mode); - public VoidCookie set_access_control (AccessControl mode); - - public VoidCookie set_close_down_mode_checked (CloseDown mode); - public VoidCookie set_close_down_mode (CloseDown mode); - - public VoidCookie kill_client_checked (uint32 resource); - public VoidCookie kill_client (uint32 resource); - - public VoidCookie rotate_properties_checked (Window window, int16 delta, [CCode (array_length_pos = 1.9, array_length_type = "uint16_t")] Atom[] atoms); - public VoidCookie rotate_properties (Window window, int16 delta, [CCode (array_length_pos = 1.9, array_length_type = "uint16_t")] Atom[] atoms); - - public VoidCookie force_screen_saver_checked (ScreenSaver mode); - public VoidCookie force_screen_saver (ScreenSaver mode); - - //set_pointer_mapping - - //get_pointer_mapping - - //set_modifier_mapping - - //get_modifier_mapping - - public VoidCookie no_operation_checked (); - public VoidCookie no_operation (); - } - - [CCode (cprefix = "XCB_CONN_", cname = "int", has_type_id = false)] - public enum ConnectionError { - ERROR, - CLOSED_EXT_NOTSUPPORTED, - CLOSED_MEM_INSUFFICIENT, - CLOSED_REQ_LEN_EXCEED, - CLOSED_PARSE_ERR, - CLOSED_INVALID_SCREEN, - CLOSED_FDPASSING_FAILED, - } - - [SimpleType] - [CCode (cname = "xcb_void_cookie_t", has_type_id = false)] - public struct VoidCookie { - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_window_attributes_cookie_t", has_type_id = false)] - public struct GetWindowAttributesCookie { - } - - [Compact] - [CCode (cname = "xcb_get_window_attributes_reply_t", ref_function = "", unref_function = "")] - public class GetWindowAttributesReply : GenericReply { - public uint8 backing_store; - public VisualID visual; - public uint16 _class; - public uint8 bit_gravity; - public uint8 win_gravity; - public uint32 backing_planes; - public uint32 backing_pixel; - public uint8 save_under; - public uint8 map_is_installed; - public uint8 map_state; - public uint8 override_redirect; - public Colormap colormap; - public uint32 all_event_masks; - public uint32 your_event_mask; - public uint16 do_not_propagate_mask; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_geometry_cookie_t", has_type_id = false)] - public struct GetGeometryCookie { - } - - [CCode (cname = "xcb_get_geometry_reply_t", ref_function = "", unref_function = "free")] - public class GetGeometryReply : GenericReply { - public uint8 depth; - public Window root; - public int16 x; - public int16 y; - public uint16 width; - public uint16 height; - public uint16 border_width; - } - - [SimpleType] - [CCode (cname = "xcb_query_tree_cookie_t", has_type_id = false)] - public struct QueryTreeCookie { - } - - [Compact] - [CCode (cname = "xcb_query_tree_reply_t", ref_function = "", unref_function = "")] - public class QueryTreeReply : GenericReply { - public Window root; - public Window parent; - private uint16 children_len; - [CCode (cname = "xcb_query_tree_children", array_length = false)] - private Window* vala_children (); - public unowned Window[] children { - get { - unowned Window[] res = (Window[]) vala_children (); - res.length = children_len; - return res; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_intern_atom_cookie_t", has_type_id = false)] - public struct InternAtomCookie { - } - - [Compact] - [CCode (cname = "xcb_intern_atom_reply_t", ref_function = "", unref_function = "free")] - public class InternAtomReply : GenericReply { - public Atom atom; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_atom_name_cookie_t", has_type_id = false)] - public struct GetAtomNameCookie { - } - - [Compact] - [CCode (cname = "xcb_get_atom_name_reply_t", ref_function = "", unref_function = "free")] - public class GetAtomNameReply : GenericReply { - private uint16 name_len; - [CCode (cname = "xcb_get_atom_name_name")] - private unowned string vala_name (); - public string name { owned get { return "%.*s".printf (name_len, vala_name ()); } } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_property_cookie_t", has_type_id = false)] - public struct GetPropertyCookie { - } - - [Compact] - [CCode (cname = "xcb_get_property_reply_t", ref_function = "", unref_function = "free")] - public class GetPropertyReply : GenericReply { - public uint8 format; - public Atom type; - public uint32 bytes_after; - private uint32 value_len; - [CCode (cname = "xcb_get_property_value")] - public unowned void *value (); - public string value_as_string () { - GLib.assert (format == 8); - return "%.*s".printf (value_len, value ()); - } - public unowned uint8[] value_as_uint8_array () { - GLib.assert (format == 8); - unowned uint8[] res = (uint8[]) value (); - res.length = (int) value_len; - return res; - } - public unowned uint16[] value_as_uint16_array () { - GLib.assert (format == 16); - unowned uint16[] res = (uint16[]) value (); - res.length = (int) value_len; - return res; - } - public unowned uint32[] value_as_uint32_array () { - GLib.assert (format == 32); - unowned uint32[] res = (uint32[]) value (); - res.length = (int) value_len; - return res; - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_list_properties_cookie_t", has_type_id = false)] - public struct ListPropertiesCookie { - } - - [Compact] - [CCode (cname = "xcb_list_properties_reply_t", ref_function = "", unref_function = "free")] - public class ListPropertiesReply : GenericReply { - private uint16 atoms_len; - [CCode (cname = "xcb_list_properties_atoms")] - private Atom* vala_atoms (); - public Atom[] atoms - { - get - { - unowned Atom[] res = (Atom[]) vala_atoms (); - res.length = atoms_len; - return res; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_selection_owner_cookie_t", has_type_id = false)] - public struct GetSelectionOwnerCookie { - } - - [Compact] - [CCode (cname = "xcb_get_selection_owner_reply_t", ref_function = "", unref_function = "free")] - public class GetSelectionOwnerReply : GenericReply { - public Window owner; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_grab_pointer_cookie_t", has_type_id = false)] - public struct GrabPointerCookie { - } - - [Compact] - [CCode (cname = "xcb_grab_pointer_reply_t", ref_function = "", unref_function = "free")] - public class GrabPointerReply : GenericReply { - public GrabStatus status; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_grab_keyboard_cookie_t", has_type_id = false)] - public struct GrabKeyboardCookie { - } - - [Compact] - [CCode (cname = "xcb_grab_keyboard_reply_t", ref_function = "", unref_function = "free")] - public class GrabKeyboardReply : GenericReply { - public GrabStatus status; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_query_pointer_cookie_t", has_type_id = false)] - public struct QueryPointerCookie { - } - - [Compact] - [CCode (cname = "xcb_query_pointer_reply_t", ref_function = "", unref_function = "free")] - public class QueryPointerReply : GenericReply { - public bool same_screen; - public Window root; - public Window child; - public int16 root_x; - public int16 root_y; - public int16 win_x; - public int16 win_y; - public KeyButMask mask; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_motion_events_cookie_t", has_type_id = false)] - public struct GetMotionEventsCookie { - } - - [Compact] - [CCode (cname = "xcb_get_motion_events_reply_t", ref_function = "", unref_function = "free")] - public class GetMotionEventsReply : GenericReply { - private uint32 events_len; - [CCode (cname = "xcb_get_motion_events_events")] - private Timecoord* vala_events (); - public unowned Timecoord[] events { - get { - unowned Timecoord[] res = (Timecoord[]) vala_events (); - res.length = (int) events_len; - return res; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_image_cookie_t", has_type_id = false)] - public struct GetImageCookie { - } - - [Compact] - [CCode (cname = "xcb_get_image_reply_t", ref_function = "", unref_function = "")] - public class GetImageReply : GenericReply { - public uint8 depth; - public VisualID visual; - private uint32 length; - [CCode (cname = "xcb_get_image_data")] - public uint8* vala_data (); - public unowned uint8[] data { - get { - unowned uint8[] res = (uint8[]) vala_data (); - res.length = (int) length; - return res; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_list_installed_colormaps_cookie_t", has_type_id = false)] - public struct ListInstalledColormapsCookie { - } - - [Compact] - [CCode (cname = "xcb_list_installed_colormaps_reply_t", ref_function = "", unref_function = "free")] - public class ListInstalledColormapsReply : GenericReply { - private uint16 cmaps_len; - [CCode (cname = "xcb_list_installed_colormaps_cmaps")] - private Colormap* vala_cmaps (); - public unowned Colormap[] cmaps { - get { - unowned Colormap[] res = (Colormap[]) vala_cmaps (); - res.length = (int) cmaps_len; - return res; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_alloc_color_cookie_t", has_type_id = false)] - public struct AllocColorCookie { - } - - [Compact] - [CCode (cname = "xcb_alloc_color_reply_t", ref_function = "", unref_function = "free")] - public class AllocColorReply : GenericReply { - public uint16 red; - public uint16 green; - public uint16 blue; - public uint32 pixel; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_alloc_named_color_cookie_t", has_type_id = false)] - public struct AllocNamedColorCookie { - } - - [Compact] - [CCode (cname = "xcb_alloc_named_color_reply_t", ref_function = "", unref_function = "free")] - public class AllocNamedColorReply : GenericReply { - public uint32 pixel; - public uint16 exact_red; - public uint16 exact_green; - public uint16 exact_blue; - public uint16 visual_red; - public uint16 visual_green; - public uint16 visual_blue; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_alloc_color_cells_cookie_t", has_type_id = false)] - public struct AllocColorCellsCookie { - } - - [Compact] - [CCode (cname = "xcb_alloc_color_cells_reply_t", ref_function = "", unref_function = "free")] - public class AllocColorCellsReply : GenericReply { - private uint16 pixels_len; - [CCode (cname = "xcb_alloc_color_cells_pixels")] - private uint32* vala_pixels (); - public unowned uint32[] pixels { - get { - unowned uint32[] res = (uint32[]) vala_pixels (); - res.length = (int) pixels_len; - return res; - } - } - private uint16 masks_len; - [CCode (cname = "xcb_alloc_color_cells_masks")] - private uint32* vala_masks (); - public unowned uint32[] masks { - get { - unowned uint32[] res = (uint32[]) vala_masks (); - res.length = (int) masks_len; - return res; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_alloc_color_planes_cookie_t", has_type_id = false)] - public struct AllocColorPlanesCookie { - } - - [Compact] - [CCode (cname = "xcb_alloc_color_planes_reply_t", ref_function = "", unref_function = "free")] - public class AllocColorPlanesReply : GenericReply { - public uint32 red_mask; - public uint32 green_mask; - public uint32 blue_mask; - private uint16 pixels_len; - [CCode (cname = "xcb_alloc_color_planes_pixels")] - private uint32* vala_pixels (); - public unowned uint32[] pixels { - get { - unowned uint32[] res = (uint32[]) vala_pixels (); - res.length = (int) pixels_len; - return res; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_query_colors_cookie_t", has_type_id = false)] - public struct QueryColorsCookie { - } - - [Compact] - [CCode (cname = "xcb_query_colors_reply_t", ref_function = "", unref_function = "free")] - public class QueryColorsReply : GenericReply { - private uint16 colors_len; - [CCode (cname = "xcb_query_colors_colors")] - private RGB* vala_colors (); - public unowned RGB[] colors { - get { - unowned RGB[] res = (RGB[]) vala_colors (); - res.length = (int) colors_len; - return res; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_lookup_color_cookie_t", has_type_id = false)] - public struct LookupColorCookie { - } - - [Compact] - [CCode (cname = "xcb_lookup_color_reply_t", ref_function = "", unref_function = "free")] - public class LookupColorReply : GenericReply { - public uint16 exact_red; - public uint16 exact_green; - public uint16 exact_blue; - public uint16 visual_red; - public uint16 visual_green; - public uint16 visual_blue; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_query_best_size_cookie_t", has_type_id = false)] - public struct QueryBestSizeCookie { - } - - [Compact] - [CCode (cname = "xcb_query_best_size_reply_t", ref_function = "", unref_function = "free")] - public class QueryBestSizeReply : GenericReply { - public uint16 width; - public uint16 height; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_query_extension_cookie_t", has_type_id = false)] - public struct QueryExtensionCookie { - } - - [Compact] - [CCode (cname = "xcb_query_extension_reply_t", ref_function = "", unref_function = "free")] - public class QueryExtensionReply : GenericReply { - public bool present; - public uint8 major_opcode; - public uint8 first_event; - public uint8 first_error; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_list_extensions_cookie_t", has_type_id = false)] - public struct ListExtensionsCookie { - } - - [Compact] - [CCode (cname = "xcb_list_extensions_reply_t", ref_function = "", unref_function = "free")] - public class ListExtensionsReply : GenericReply { - private uint8 names_len; - [CCode (cname = "xcb_list_extensions_names_iterator")] - private StrIterator names_iterator (); - public string[] names { - owned get { - var value = new string[names_len]; - var iter = names_iterator (); - for (var i = 0; i < value.length; i++) { - value[i] = iter.data.name; - StrIterator.next (ref iter); - } - return value; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_keyboard_mapping_cookie_t", has_type_id = false)] - public struct GetKeyboardMappingCookie { - } - - //[Compact] - //[CCode (cname = "xcb_get_keyboard_mapping_reply_t", ref_function = "", unref_function = "free")] - //public class GetKeyboardMappingReply : GenericReply { - //} - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_keyboard_control_cookie_t", has_type_id = false)] - public struct GetKeyboardControlCookie { - } - - [Compact] - [CCode (cname = "xcb_get_keyboard_control_reply_t", ref_function = "", unref_function = "free")] - public class GetKeyboardControlReply : GenericReply { - public uint8 key_click_percent; - public uint8 bell_percent; - public uint16 bell_pitch; - public uint16 bell_duration; - public uint32 led_mask; - public AutoRepeatMode global_auto_repeat; - [CCode (cname = "auto_repeats")] - private uint32* vala_auto_repeats; - public unowned uint32[] auto_repeats { - get { - unowned uint32[] res = (uint32[]) vala_auto_repeats; - res.length = 32; - return res; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_pointer_control_cookie_t", has_type_id = false)] - public struct GetPointerControlCookie { - } - - [Compact] - [CCode (cname = "xcb_get_pointer_control_reply_t", ref_function = "", unref_function = "free")] - public class GetPointerControlReply : GenericReply { - public uint16 acceleration_numerator; - public uint16 acceleration_denominator; - public uint16 threshold; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_screen_saver_cookie_t", has_type_id = false)] - public struct GetScreenSaverCookie { - } - - [Compact] - [CCode (cname = "xcb_get_screen_saver_reply_t", ref_function = "", unref_function = "free")] - public class GetScreenSaverReply : GenericReply { - public uint16 timeout; - public uint16 interval; - public bool prefer_blanking; - public bool allow_exposures; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_list_hosts_cookie_t", has_type_id = false)] - public struct ListHostsCookie { - } - - [Compact] - [CCode (cname = "xcb_list_hosts_reply_t", ref_function = "", unref_function = "free")] - public class ListHostsReply : GenericReply { - private uint16 hosts_len; - [CCode (cname = "xcb_list_hosts_hosts_iterator")] - private HostIterator hosts_iterator (); - public Host[] hosts { - owned get { - var value = new Host[hosts_len]; - var iter = hosts_iterator (); - for (var i = 0; i < value.length; i++) { - value[i] = iter.data; - HostIterator.next (ref iter); - } - return value; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_set_pointer_mapping_cookie_t", has_type_id = false)] - public struct SetPointerMappingCookie { - } - - //[Compact] - //[CCode (cname = "xcb_set_pointer_mapping_reply_t", ref_function = "", unref_function = "free")] - //public class SetPointerMappingReply : GenericReply { - //} - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_pointer_mapping_cookie_t", has_type_id = false)] - public struct GetPointerMappingCookie { - } - - //[Compact] - //[CCode (cname = "xcb_get_pointer_mapping_reply_t", ref_function = "", unref_function = "free")] - //public class GetPointerMappingReply : GenericReply { - //} - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_set_modifier_mapping_cookie_t", has_type_id = false)] - public struct SetModifierMappingCookie { - } - - //[Compact] - //[CCode (cname = "xcb_set_modifier_mapping_reply_t", ref_function = "", unref_function = "free")] - //public class SetModifierMappingReply : GenericReply { - //} - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_modifier_mapping_cookie_t", has_type_id = false)] - public struct GetModifierMappingCookie { - } - - //[Compact] - //[CCode (cname = "xcb_get_modifier_mapping_reply_t", ref_function = "", unref_function = "free")] - //public class GetModifierMappingReply : GenericReply { - //} - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_translate_coordinates_cookie_t", has_type_id = false)] - public struct TranslateCoordinatesCookie { - } - - [Compact] - [CCode (cname = "xcb_translate_coordinates_reply_t", ref_function = "", unref_function = "free")] - public class TranslateCoordinatesReply : GenericReply { - public bool same_screen; - public Window child; - public int16 dst_x; - public int16 dst_y; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_input_focus_cookie_t", has_type_id = false)] - public struct GetInputFocusCookie { - } - - [Compact] - [CCode (cname = "xcb_get_input_focus_reply_t", ref_function = "", unref_function = "free")] - public class GetInputFocusReply : GenericReply { - public InputFocus revert_to; - public Window focus; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_query_keymap_cookie_t", has_type_id = false)] - public struct QueryKeymapCookie { - } - - [Compact] - [CCode (cname = "xcb_query_keymap_reply_t", ref_function = "", unref_function = "free")] - public class QueryKeymapReply : GenericReply { - [CCode (cname = "keys")] - private uint32* vala_keys; - public unowned uint32[] keys { - get { - unowned uint32[] res = (uint32[]) vala_keys; - res.length = 32; - return res; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_query_font_cookie_t", has_type_id = false)] - public struct QueryFontCookie { - } - - [Compact] - [CCode (cname = "xcb_query_font_reply_t", ref_function = "", unref_function = "free")] - public class QueryFontReply : GenericReply { - public Charinfo min_bounds; - public Charinfo max_bounds; - public uint16 min_char_or_byte2; - public uint16 max_char_or_byte2; - public uint16 default_char; - public FontDraw draw_direction; - public uint8 min_byte1; - public uint8 max_byte1; - public bool all_chars_exist; - public int16 font_ascent; - public int16 font_descent; - private uint16 properties_len; - [CCode (cname = "xcb_query_font_properties")] - private Fontprop* vala_properties (); - public unowned Fontprop[] properties { - get { - unowned Fontprop[] res = (Fontprop[]) vala_properties (); - res.length = properties_len; - return res; - } - } - private uint32 char_infos_len; - [CCode (cname = "xcb_query_font_char_infos")] - private Charinfo* vala_char_infos (); - public unowned Charinfo[] char_infos { - get { - unowned Charinfo[] res = (Charinfo[]) vala_char_infos (); - res.length = (int) char_infos_len; - return res; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_query_text_extents_cookie_t", has_type_id = false)] - public struct QueryTextExtentsCookie { - } - - [Compact] - [CCode (cname = "xcb_query_text_extents_reply_t", ref_function = "", unref_function = "free")] - public class QueryTextExtentsReply : GenericReply { - public FontDraw draw_direction; - public int16 font_ascent; - public int16 font_descent; - public int16 overall_ascent; - public int16 overall_descent; - public int16 overall_width; - public int16 overall_height; - public int16 overall_left; - public int16 overall_right; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_list_fonts_cookie_t", has_type_id = false)] - public struct ListFontsCookie { - } - - [Compact] - [CCode (cname = "xcb_list_fonts_reply_t", ref_function = "", unref_function = "free")] - public class ListFontsReply : GenericReply { - private uint16 names_len; - [CCode (cname = "xcb_list_fonts_names_iterator")] - private StrIterator names_iterator (); - public string[] names { - owned get { - var value = new string[names_len]; - var iter = names_iterator (); - for (var i = 0; i < value.length; i++) { - value[i] = iter.data.name; - StrIterator.next (ref iter); - } - return value; - } - } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_list_fonts_with_info_cookie_t", has_type_id = false)] - public struct ListFontsWithInfoCookie { - } - - [Compact] - [CCode (cname = "xcb_list_fonts_with_info_reply_t", ref_function = "", unref_function = "free")] - public class ListFontsWithInfoReply : GenericReply { - public Charinfo min_bounds; - public Charinfo max_bounds; - public uint16 min_char_or_byte2; - public uint16 max_char_or_byte2; - public uint16 default_char; - public FontDraw draw_direction; - public uint8 min_byte1; - public uint8 max_byte1; - public bool all_chars_exist; - public int16 font_ascent; - public int16 font_descent; - public uint32 replies_hint; - private uint16 properties_len; - [CCode (cname = "xcb_list_fonts_with_info_properties")] - private Fontprop* vala_properties (); - public unowned Fontprop[] properties { - get { - unowned Fontprop[] res = (Fontprop[]) vala_properties (); - res.length = properties_len; - return res; - } - } - private uint8 name_len; - [CCode (cname = "xcb_list_fonts_with_info_name")] - private unowned string vala_name (); - public string name { owned get { return "%.*s".printf (name_len, vala_name ()); } } - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_get_font_path_cookie_t", has_type_id = false)] - public struct GetFontPathCookie { - } - - [Compact] - [CCode (cname = "xcb_get_font_path_reply_t", ref_function = "", unref_function = "free")] - public class GetFontPathReply : GenericReply { - private uint16 path_len; - [CCode (cname = "xcb_get_font_path_path_iterator")] - private StrIterator path_iterator (); - public string[] path { - owned get { - var value = new string[path_len]; - var iter = path_iterator (); - for (var i = 0; i < value.length; i++) { - value[i] = iter.data.name; - StrIterator.next (ref iter); - } - return value; - } - } - } - - [CCode (cname = "xcb_circulate_t", has_type_id = false)] - public enum Circulate { - RAISE_LOWEST, - LOWER_HIGHEST - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_atom_t", has_type_id = false)] - public struct Atom { - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_fontable_t", has_type_id = false)] - public struct Fontable { - } - - [CCode (cname = "xcb_prop_mode_t", has_type_id = false)] - public enum PropMode { - REPLACE, - PREPEND, - APPEND - } - - [CCode (cname = "xcb_grab_mode_t", has_type_id = false)] - public enum GrabMode { - SYNC, - ASYNC - } - - [CCode (cname = "xcb_grab_status_t", has_type_id = false)] - public enum GrabStatus { - SUCCESS, - ALREADY_GRABBED, - INVALID_TIME, - NOT_VIEWABLE, - FROZEN - } - - [SimpleType] - [CCode (cname = "xcb_timecoord_t", has_type_id = false)] - public struct Timecoord { - public Timestamp time; - public int16 x; - public int16 y; - } - - [SimpleType] - [CCode (cname = "xcb_timecoord_iterator_t", has_type_id = false)] - private struct TimecoordIterator { - public unowned Timecoord data; - public int rem; - public int index; - [CCode (cname = "xcb_timecoord_next")] - public static void next (ref TimecoordIterator iter); - } - - [CCode (cname = "xcb_motion_t", has_type_id = false)] - public enum Motion { - NORMAL, - HINT - } - - [CCode (cname = "xcb_notify_detail_t", has_type_id = false)] - public enum NotifyDetail { - ANCESTOR, - VIRTUAL, - INFERIOR, - NONLINEAR, - NONLINEAR_VIRTUAL, - POINTER, - POINTER_ROOT, - NONE - } - - [CCode (cname = "xcb_notify_mode_t", has_type_id = false)] - public enum NotifyMode { - NORMAL, - GRAB, - UNGRAB, - WHILE_GRABBED - } - - [CCode (cname = "xcb_visibility_t", has_type_id = false)] - public enum Visibility { - UNOBSCURED, - PARTIALLY_OBSCURED, - FULLY_OBSCURED - } - - [CCode (cname = "xcb_place_t", has_type_id = false)] - public enum Place { - ON_TOP, - ON_BOTTOM - } - - [CCode (cname = "xcb_property_t", has_type_id = false)] - public enum Property { - NEW_VALUE, - DELETE - } - - [CCode (cname = "xcb_atom_enum_t", cprefix = "XCB_ATOM_", has_type_id = false)] - public enum AtomEnum { - NONE, - ANY, - PRIMARY, - SECONDARY, - ARC, - ATOM, - BITMAP, - CARDINAL, - COLORMAP, - CURSOR, - CUT_BUFFER0, - CUT_BUFFER1, - CUT_BUFFER2, - CUT_BUFFER3, - CUT_BUFFER4, - CUT_BUFFER5, - CUT_BUFFER6, - CUT_BUFFER7, - DRAWABLE, - FONT, - INTEGER, - PIXMAP, - POINT, - RECTANGLE, - RESOURCE_MANAGER, - RGB_COLOR_MAP, - RGB_BEST_MAP, - RGB_BLUE_MAP, - RGB_DEFAULT_MAP, - RGB_GRAY_MAP, - RGB_GREEN_MAP, - RGB_RED_MAP, - STRING, - VISUALID, - WINDOW, - WM_COMMAND, - WM_HINTS, - WM_CLIENT_MACHINE, - WM_ICON_NAME, - WM_ICON_SIZE, - WM_NAME, - WM_NORMAL_HINTS, - WM_SIZE_HINTS, - WM_ZOOM_HINTS, - MIN_SPACE, - NORM_SPACE, - MAX_SPACE, - END_SPACE, - SUPERSCRIPT_X, - SUPERSCRIPT_Y, - SUBSCRIPT_X, - SUBSCRIPT_Y, - UNDERLINE_POSITION, - UNDERLINE_THICKNESS, - STRIKEOUT_ASCENT, - STRIKEOUT_DESCENT, - ITALIC_ANGLE, - X_HEIGHT, - QUAD_WIDTH, - WEIGHT, - POINT_SIZE, - RESOLUTION, - COPYRIGHT, - NOTICE, - FONT_NAME, - FAMILY_NAME, - FULL_NAME, - CAP_HEIGHT, - WM_CLASS, - WM_TRANSIENT_FOR - } - - [CCode (cname = "xcb_colormap_state_t", has_type_id = false)] - public enum ColormapState { - UNINSTALLED, - INSTALLED - } - - public const uint8 KEY_PRESS; - public const uint8 KEY_RELEASE; - public const uint8 BUTTON_PRESS; - public const uint8 BUTTON_RELEASE; - public const uint8 MOTION_NOTIFY; - public const uint8 ENTER_NOTIFY; - public const uint8 LEAVE_NOTIFY; - public const uint8 FOCUS_IN; - public const uint8 FOCUS_OUT; - public const uint8 KEYMAP_NOTIFY; - public const uint8 EXPOSE; - public const uint8 GRAPHICS_EXPOSURE; - public const uint8 NO_EXPOSURE; - public const uint8 VISIBILITY_NOTIFY; - public const uint8 CREATE_NOTIFY; - public const uint8 DESTROY_NOTIFY; - public const uint8 UNMAP_NOTIFY; - public const uint8 MAP_NOTIFY; - public const uint8 MAP_REQUEST; - public const uint8 REPARENT_NOTIFY; - public const uint8 CONFIGURE_NOTIFY; - public const uint8 CONFIGURE_REQUEST; - public const uint8 GRAVITY_NOTIFY; - public const uint8 RESIZE_REQUEST; - public const uint8 CIRCULATE_NOTIFY; - public const uint8 CIRCULATE_REQUEST; - public const uint8 PROPERTY_NOTIFY; - public const uint8 SELECTION_CLEAR; - public const uint8 SELECTION_REQUEST; - public const uint8 SELECTION_NOTIFY; - public const uint8 COLORMAP_NOTIFY; - public const uint8 CLIENT_MESSAGE; - public const uint8 MAPPING_NOTIFY; - - [CCode (cname = "xcb_config_window_t", has_type_id = false)] - public enum ConfigWindow { - X, - Y, - WIDTH, - HEIGHT, - BORDER_WIDTH, - SIBLING, - STACK_MODE - } - - [CCode (cname = "xcb_image_order_t", has_type_id = false)] - public enum ImageOrder { - LSB_FIRST, - MSB_FIRST - } - - [CCode (cname = "xcb_mod_mask_t", has_type_id = false)] - public enum ModMask { - SHIFT, - LOCK, - CONTROL, - [CCode (cname = "XCB_MOD_MASK_1")] - MOD_1, - [CCode (cname = "XCB_MOD_MASK_2")] - MOD_2, - [CCode (cname = "XCB_MOD_MASK_3")] - MOD_3, - [CCode (cname = "XCB_MOD_MASK_4")] - MOD_4, - [CCode (cname = "XCB_MOD_MASK_5")] - MOD_5, - ANY - } - - [CCode (cname = "xcb_key_but_mask_t", has_type_id = false)] - public enum KeyButMask { - SHIFT, - LOCK, - CONTROL, - MOD_1, - MOD_2, - MOD_3, - MOD_4, - MOD_5, - BUTTON_1, - BUTTON_2, - BUTTON_3, - BUTTON_4, - BUTTON_5 - } - - [Compact] - [CCode (cname = "xcb_setup_t", ref_function = "", unref_function = "")] - public class Setup { - public uint8 status; - public uint16 protocol_major_version; - public uint16 protocol_minor_version; - public uint32 release_number; - public uint32 resource_id_base; - public uint32 resource_id_mask; - public uint32 motion_buffer_size; - private uint16 vendor_len; - [CCode (cname = "xcb_setup_vendor")] - private unowned string vala_vendor (); - public string vendor { owned get { return "%.*s".printf (vendor_len, vala_vendor ()); } } - public uint32 maximum_request_length; - public uint8 image_byte_order; - public uint8 bitmap_format_bit_order; - public uint8 bitmap_format_scanline_unit; - public uint8 bitmap_format_scanline_pad; - public Keycode min_keycode; - public Keycode max_keycode; - private uint8 pixmap_formats_len; - [CCode (cname = "xcb_setup_pixmap_formats")] - private Format* vala_pixmap_formats (); - public unowned Format[] pixmap_formats { - get { - unowned Format[] res = (Format[]) vala_pixmap_formats (); - res.length = pixmap_formats_len; - return res; - } - } - private uint8 roots_len; - [Version (deprecated = true, deprecated_since = "vala-0.26", replacement = "Xcb.Setup.screens")] - public int roots_length (); - public ScreenIterator roots_iterator (); - public Screen[] screens { - owned get { - var value = new Screen[roots_len]; - var iter = roots_iterator (); - for (var i = 0; i < value.length; i++) { - value[i] = iter.data; - ScreenIterator.next (ref iter); - } - return value; - } - } - } - - public const char COPY_FROM_PARENT; - - [CCode (cname = "xcb_window_class_t", has_type_id = false)] - public enum WindowClass { - COPY_FROM_PARENT, - INPUT_OUTPUT, - INPUT_ONLY - } - - [Compact] - [CCode (cname = "xcb_ge_generic_event_t", ref_function = "", unref_function = "")] - public class GenericEvent { - public uint8 response_type; - public uint8 extension; - public uint16 sequence; - public uint32 length; - public uint16 event_type; - public uint32 full_sequence; - } - - [Compact] - [CCode (cname = "xcb_generic_reply_t", ref_function = "", unref_function = "")] - public class GenericReply { - public uint8 response_type; - public uint16 sequence; - public uint32 length; - } - - [SimpleType] - [CCode (cname = "xcb_timestamp_t", has_type_id = false)] - public struct Timestamp : uint32 { - } - - [SimpleType] - [CCode (cname = "xcb_keycode_t", has_type_id = false)] - public struct Keycode : uint8 { - } - - [SimpleType] - [CCode (cname = "xcb_colormap_t", has_type_id = false)] - public struct Colormap : uint32 { - } - - [Compact] - [CCode (cname = "xcb_key_press_event_t", ref_function = "", unref_function = "")] - public class KeyPressEvent : GenericEvent { - public Keycode detail; - public Timestamp time; - public Window root; - public Window event; - public Window child; - public uint16 root_x; - public uint16 root_y; - public uint16 event_x; - public uint16 event_y; - public KeyButMask state; - public bool same_screen; - } - - [Compact] - [CCode (cname = "xcb_key_release_event_t", ref_function = "", unref_function = "")] - public class KeyReleaseEvent : GenericEvent { - public Keycode detail; - public Timestamp time; - public Window root; - public Window event; - public Window child; - public uint16 root_x; - public uint16 root_y; - public uint16 event_x; - public uint16 event_y; - public KeyButMask state; - public bool same_screen; - } - - [Compact] - [CCode (cname = "xcb_generic_error_t", ref_function = "", unref_function = "")] - public class GenericError { - public uint8 response_type; - public uint8 error_code; - public uint16 sequence; - public uint32 resource_id; - public uint16 minor_code; - public uint8 major_code; - } - - [Compact] - [CCode (cname = "xcb_button_press_event_t", ref_function = "", unref_function = "")] - public class ButtonPressEvent : GenericEvent { - public Button detail; - public Timestamp time; - public Window root; - public Window event; - public Window child; - public uint16 root_x; - public uint16 root_y; - public uint16 event_x; - public uint16 event_y; - public KeyButMask state; - public bool same_screen; - } - - [Compact] - [CCode (cname = "xcb_button_release_event_t", ref_function = "", unref_function = "")] - public class ButtonReleaseEvent : GenericEvent { - public Button detail; - public Timestamp time; - public Window root; - public Window event; - public Window child; - public uint16 root_x; - public uint16 root_y; - public uint16 event_x; - public uint16 event_y; - public KeyButMask state; - public bool same_screen; - } - - [Compact] - [CCode (cname = "xcb_motion_notify_event_t", ref_function = "", unref_function = "")] - public class MotionNotifyEvent : GenericEvent { - public uint8 detail; - public Timestamp time; - public Window root; - public Window event; - public Window child; - public uint16 root_x; - public uint16 root_y; - public uint16 event_x; - public uint16 event_y; - public uint16 state; - public bool same_screen; - } - - [Compact] - [CCode (cname = "xcb_expose_event_t", ref_function = "", unref_function = "")] - public class ExposeEvent : GenericEvent { - public Window window; - public uint16 x; - public uint16 y; - public uint16 width; - public uint16 height; - public uint16 count; - } - - [Compact] - [CCode (cname = "xcb_enter_notify_event_t", ref_function = "", unref_function = "")] - public class EnterNotifyEvent : GenericEvent { - public NotifyDetail detail; - public Timestamp time; - public Window root; - public Window event; - public Window child; - public uint16 root_x; - public uint16 root_y; - public uint16 event_x; - public uint16 event_y; - public uint16 state; - public NotifyMode mode; - public bool same_screen_focus; - } - - [Compact] - [CCode (cname = "xcb_leave_notify_event_t", ref_function = "", unref_function = "")] - public class LeaveNotifyEvent : GenericEvent { - public NotifyDetail detail; - public Timestamp time; - public Window root; - public Window event; - public Window child; - public uint16 root_x; - public uint16 root_y; - public uint16 event_x; - public uint16 event_y; - public uint16 state; - public NotifyMode mode; - public bool same_screen_focus; - } - - [Compact] - [CCode (cname = "xcb_keymap_notify_event_t", ref_function = "", unref_function = "")] - public class KeymapNotifyEvent : GenericEvent { - public uint8[] keys; - } - - [Compact] - [CCode (cname = "xcb_visibility_notify_event_t", ref_function = "", unref_function = "")] - public class VisibilityNotifyEvent : GenericEvent { - public Window window; - public Visibility state; - } - - [Compact] - [CCode (cname = "xcb_create_notify_event_t", ref_function = "", unref_function = "")] - public class CreateNotifyEvent : GenericEvent { - public Window parent; - public Window window; - public int16 x; - public int16 y; - public uint16 width; - public uint16 height; - public uint16 border_width; - public bool override_redirect; - } - - [Compact] - [CCode (cname = "xcb_destroy_notify_event_t", ref_function = "", unref_function = "")] - public class DestroyNotifyEvent : GenericEvent { - public Window event; - public Window window; - } - - [Compact] - [CCode (cname = "xcb_unmap_notify_event_t", ref_function = "", unref_function = "")] - public class UnmapNotifyEvent : GenericEvent { - public Window event; - public Window window; - public bool from_configure; - } - - [Compact] - [CCode (cname = "xcb_map_notify_event_t", ref_function = "", unref_function = "")] - public class MapNotifyEvent : GenericEvent { - public Window event; - public Window window; - public bool override_redirect; - } - - [Compact] - [CCode (cname = "xcb_map_request_event_t", ref_function = "", unref_function = "")] - public class MapRequestEvent : GenericEvent { - public Window parent; - public Window window; - } - - [Compact] - [CCode (cname = "xcb_reparent_notify_event_t", ref_function = "", unref_function = "")] - public class ReparentNotifyEvent : GenericEvent { - public Window event; - public Window window; - public Window parent; - public int16 x; - public int16 y; - public bool override_redirect; - } - - [Compact] - [CCode (cname = "xcb_configure_request_event_t", ref_function = "", unref_function = "")] - public class ConfigureRequestEvent : GenericEvent { - public uint8 stack_mode; - public Window parent; - public Window window; - public Window sibling; - public int16 x; - public int16 y; - public uint16 width; - public uint16 height; - public uint16 border_width; - public ConfigWindow value_mask; - } - - [Compact] - [CCode (cname = "xcb_configure_notify_event_t", ref_function = "", unref_function = "")] - public class ConfigureNotifyEvent : GenericEvent { - public Window event; - public Window window; - public Window above_sibling; - public int16 x; - public int16 y; - public uint16 width; - public uint16 height; - public uint16 border_width; - public bool override_redirect; - } - - [Compact] - [CCode (cname = "xcb_gravity_notify_event_t", ref_function = "", unref_function = "")] - public class GravityNotifyEvent : GenericEvent { - public Window event; - public Window window; - public int16 x; - public int16 y; - } - - [Compact] - [CCode (cname = "xcb_circulate_notify_event_t", ref_function = "", unref_function = "")] - public class CirculateNotifyEvent : GenericEvent { - public Window event; - public Window window; - public Place place; - } - - [Compact] - [CCode (cname = "xcb_property_notify_event_t", ref_function = "", unref_function = "")] - public class PropertyNotifyEvent : GenericEvent { - public Window window; - public Atom atom; - public Timestamp time; - public Property state; - } - - [Compact] - [CCode (cname = "xcb_selection_notify_event_t", ref_function = "", unref_function = "")] - public class SelectionNotifyEvent : GenericEvent { - public Timestamp time; - public Window requestor; - public Atom selection; - public Atom target; - public Atom property; - } - - [Compact] - [CCode (cname = "xcb_colormap_notify_event_t", ref_function = "", unref_function = "")] - public class ColormapNotifyEvent : GenericEvent { - public Window window; - public Colormap colormap; - public bool _new; - public ColormapState state; - } - - [Compact] - [CCode (cname = "xcb_mapping_notify_event_t", ref_function = "", unref_function = "")] - public class MappingNotifyEvent : GenericEvent { - public uint8 request; - public Keycode first_keycode; - public uint8 count; - } - - [CCode (cname = "xcb_cw_t", has_type_id = false)] - public enum CW { - BACK_PIXMAP, - BACK_PIXEL, - BORDER_PIXMAP, - BORDER_PIXEL, - BIT_GRAVITY, - WIN_GRAVITY, - BACKING_STORE, - BACKING_PLANES, - BACKING_PIXEL, - OVERRIDE_REDIRECT, - SAVE_UNDER, - EVENT_MASK, - DONT_PROPAGATE, - COLORMAP, - CURSOR - } - - [CCode (cname = "xcb_event_mask_t", has_type_id = false)] - public enum EventMask { - NO_EVENT, - KEY_PRESS, - KEY_RELEASE, - BUTTON_PRESS, - BUTTON_RELEASE, - ENTER_WINDOW, - LEAVE_WINDOW, - POINTER_MOTION, - POINTER_MOTION_HINT, - BUTTON_1_MOTION, - BUTTON_2_MOTION, - BUTTON_3_MOTION, - BUTTON_4_MOTION, - BUTTON_5_MOTION, - BUTTON_MOTION, - KEYMAP_STATE, - EXPOSURE, - VISIBILITY_CHANGE, - STRUCTURE_NOTIFY, - RESIZE_REDIRECT, - SUBSTRUCTURE_NOTIFY, - SUBSTRUCTURE_REDIRECT, - FOCUS_CHANGE, - PROPERTY_CHANGE, - COLOR_MAP_CHANGE, - OWNER_GRAB_BUTTON - } - - // [Simple] - [CCode (cname = "xcb_format_t", has_type_id = false)] - public struct Format { - public uint8 depth; - public uint8 bits_per_pixel; - public uint8 scanline_pad; - } - - [SimpleType] - [CCode (cname = "xcb_format_iterator_t", has_type_id = false)] - private struct FormatIterator { - public unowned Format data; - public int rem; - public int index; - [CCode (cname = "xcb_format_next")] - public static void next (ref FormatIterator iter); - } - - [Compact] - [CCode (cname = "xcb_screen_t", ref_function = "", unref_function = "")] - public class Screen { - public Window root; - public Colormap default_colormap; - public uint32 white_pixel; - public uint32 black_pixel; - public uint32 current_input_masks; - public uint16 width_in_pixels; - public uint16 height_in_pixels; - public uint16 width_in_millimeters; - public uint16 height_in_millimeters; - public uint16 min_installed_maps; - public uint16 max_installed_maps; - public VisualID root_visual; - public uint8 backing_stores; - public uint8 save_unders; - public uint8 root_depth; - private uint8 allowed_depths_len; - public DepthIterator allowed_depths_iterator (); - public Depth[] allowed_depths { - owned get { - var value = new Depth[allowed_depths_len]; - var iter = allowed_depths_iterator (); - for (var i = 0; i < value.length; i++) { - value[i] = iter.data; - DepthIterator.next (ref iter); - } - return value; - } - } - } - - [SimpleType] - [CCode (cname = "xcb_screen_iterator_t", has_type_id = false)] - public struct ScreenIterator { - public unowned Screen data; - public int rem; - public int index; - [CCode (cname = "xcb_screen_next")] - public static void next (ref ScreenIterator iter); - } - - [Compact] - [CCode (cname = "xcb_depth_t", ref_function = "", unref_function = "")] - public class Depth { - public uint8 depth; - private uint16 visuals_len; - [CCode (cname = "xcb_depth_visuals")] - private VisualType* vala_visuals (); - public unowned VisualType[] visuals { - get { - unowned VisualType[] res = (VisualType[]) vala_visuals (); - res.length = (int) visuals_len; - return res; - } - } - [Version (deprecated = true, deprecated_since = "vala-0.26", replacement = "Xcb.Depth.visuals")] - public VisualTypeIterator visuals_iterator (); - } - - [SimpleType] - [CCode (cname = "xcb_depth_iterator_t", has_type_id = false)] - public struct DepthIterator { - public unowned Depth data; - public int rem; - [CCode (cname = "xcb_depth_next")] - public static void next (ref DepthIterator iter); - } - - // [Version (deprecated = true, deprecated_since = "vala-0.26", replacement = "Xcb.Depth.visuals")] - [SimpleType] - [CCode (cname = "xcb_visualtype_iterator_t", has_type_id = false)] - public struct VisualTypeIterator { - public unowned VisualType data; - public int rem; - [CCode (cname = "xcb_visualtype_next")] - public static void next (ref VisualTypeIterator iter); - } - - [Version (deprecated = true, deprecated_since = "vala-0.14", replacement = "Xcb.Connection")] - public Connection connect (string? display = null, out int screen = null); - [Version (deprecated = true, deprecated_since = "vala-0.14", replacement = "Xcb.Connection.create_window")] - public VoidCookie create_window (Connection connection, uint8 depth, Window window, Window parent, int16 x, int16 y, uint16 width, uint16 height, uint16 border_width, uint16 _class, VisualID visual, uint32 value_mask, [CCode (array_length = false)] uint32[] value_list); - [Version (deprecated = true, deprecated_since = "vala-0.14", replacement = "Xcb.Connection.map_window")] - public VoidCookie map_window (Connection connection, Window window); - - [CCode (cname = "xcb_point_t", has_type_id = false)] - public struct Point { - public int16 x; - public int16 y; - } - - [CCode (cname = "xcb_rectangle_t", has_type_id = false)] - public struct Rectangle { - public int16 x; - public int16 y; - public uint16 width; - public uint16 height; - } - - [CCode (cname = "xcb_arc_t", has_type_id = false)] - public struct Arc { - public int16 x; - public int16 y; - public uint16 width; - public uint16 height; - public int16 angle1; - public int16 angle2; - } - - [CCode (cname = "xcb_segment_t", has_type_id = false)] - public struct Segment { - public int16 x1; - public int16 y1; - public int16 x2; - public int16 y2; - } - - [SimpleType] - [CCode (cname = "xcb_visualid_t", has_type_id = false)] - public struct VisualID : uint32 { - } - - [SimpleType] - [CCode (cname = "xcb_keysym_t", has_type_id = false)] - public struct KeySym : uint32 { - } - - [SimpleType] - [CCode (cname = "xcb_button_t", has_type_id = false)] - public struct Button : uint8 { - } - - [SimpleType] - [CCode (cname = "xcb_gcontext_t", has_type_id = false)] - public struct GContext : uint32 { - } - - [SimpleType] - [CCode (cname = "xcb_drawable_t", has_type_id = false)] - public struct Drawable : uint32 { - } - - [SimpleType] - [CCode (cname = "xcb_pixmap_t", has_type_id = false)] - public struct Pixmap : uint32 { - } - - [SimpleType] - [CCode (cname = "xcb_cursor_t", has_type_id = false)] - public struct Cursor : uint32 { - } - - [SimpleType] - [CCode (cname = "xcb_font_t", has_type_id = false)] - public struct Font : uint32 { - } - - [SimpleType] - [CCode (cname = "xcb_window_t", has_type_id = false)] - public struct Window : uint32 { - } - - [CCode (cname = "xcb_visual_class_t", has_type_id = false)] - public enum VisualClass { - STATIC_GRAY, - GRAY_SCALE, - STATIC_COLOR, - PSEUDO_COLOR, - TRUE_COLOR, - DIRECT_COLOR - } - - [SimpleType] - [CCode (cname = "xcb_visualtype_t", has_type_id = false)] - public struct VisualType { - public VisualID visual_id; - public VisualClass _class; - public uint8 bits_per_rgb_value; - public uint16 colormap_entries; - public uint32 red_mask; - public uint32 green_mask; - public uint32 blue_mask; - } - - [CCode (cname = "xcb_allow_t", has_type_id = false)] - public enum Allow { - ASYNC_POINTER, - SYNC_POINTER, - REPLAY_POINTER, - ASYNC_KEYBOARD, - SYNC_KEYBOARD, - REPLAY_KEYBOARD, - ASYNC_BOTH, - SYNC_BOTH - } - - [CCode (cname = "xcb_input_focus_t", has_type_id = false)] - public enum InputFocus { - NONE, - POINTER_ROOT, - PARENT, - FOLLOW_KEYBOARD - } - - [CCode (cname = "xcb_font_draw_t", has_type_id = false)] - public enum FontDraw { - LEFT_TO_RIGHT, - RIGHT_TO_LEFT - } - - [CCode (cname = "xcb_gc_t", has_type_id = false)] - public enum GC { - FUNCTION, - PLANE_MASK, - FOREGROUND, - BACKGROUND, - LINE_WIDTH, - LINE_STYLE, - CAP_STYLE, - JOIN_STYLE, - FILL_STYLE, - FILL_RULE, - TILE, - STIPPLE, - TILE_STIPPLE_ORIGIN_X, - TILE_STIPPLE_ORIGIN_Y, - FONT, - SUBWINDOW_MODE, - GRAPHICS_EXPOSURES, - CLIP_ORIGIN_X, - CLIP_ORIGIN_Y, - CLIP_MASK, - DASH_OFFSET, - DASH_LIST, - ARC_MODE - } - - [CCode (cname = "xcb_gx_t", has_type_id = false)] - public enum GX { - CLEAR, - AND, - AND_REVERSE, - COPY, - AND_INVERTED, - NOOP, - XOR, - OR, - NOR, - EQUIV, - INVERT, - OR_REVERSE, - COPY_INVERTED, - OR_INVERTED, - NAND, - SET - } - - [CCode (cname = "xcb_line_style_t", has_type_id = false)] - public enum LineStyle { - SOLID, - ON_OFF_DASH, - DOUBLE_DASH - } - - [CCode (cname = "xcb_cap_style_t", has_type_id = false)] - public enum CapStyle { - NOT_LAST, - BUTT, - ROUND, - PROJECTING - } - - [CCode (cname = "xcb_join_style_t", has_type_id = false)] - public enum JoinStyle { - MITER, - ROUND, - BEVEL - } - - [CCode (cname = "xcb_fill_style_t", has_type_id = false)] - public enum FillStyle { - SOLID, - TILED, - STIPPLED, - OPAQUE_STIPPLED - } - - [CCode (cname = "xcb_fill_rule_t", has_type_id = false)] - public enum FillRuleStyle { - EVEN_ODD, - WINDING - } - - [CCode (cname = "xcb_subwindow_mode_t", has_type_id = false)] - public enum SubwindowMode { - CLIP_BY_CHILDREN, - INCLUDE_INFERIORS - } - - [CCode (cname = "xcb_arc_mode_t", has_type_id = false)] - public enum ArcMode { - CHORD, - PIE_SLICE - } - - [CCode (cname = "xcb_clip_ordering_t", has_type_id = false)] - public enum ClipOrdering { - UNSORTED, - Y_SORTED, - YX_SORTED, - YX_BANDED - } - - [CCode (cname = "xcb_coord_mode_t", has_type_id = false)] - public enum CoordMode { - ORIGIN, - PREVIOUS - } - - [CCode (cname = "xcb_poly_shape_t", has_type_id = false)] - public enum PolyShape { - COMPLEX, - NONCONVEX, - CONVEX - } - - [CCode (cname = "xcb_image_format_t", has_type_id = false)] - public enum ImageFormat { - XY_BITMAP, - XY_PIXMAP, - Z_PIXMAP - } - - [CCode (cname = "xcb_color_flag_t", has_type_id = false)] - public enum ColorFlag { - RED, - GREEN, - BLUE - } - - [SimpleType] - [CCode (cname = "xcb_coloritem_t", has_type_id = false)] - public struct Coloritem { - public uint32 pixel; - public uint16 red; - public uint16 green; - public uint16 blue; - public ColorFlag flags; - } - - [SimpleType] - [CCode (cname = "xcb_rgb_t", has_type_id = false)] - public struct RGB { - public uint16 red; - public uint16 green; - public uint16 blue; - } - - [CCode (cname = "xcb_query_shape_of_t", has_type_id = false)] - public enum QueryShapeOf { - LARGEST_CURSOR, - FASTEST_TILE, - FASTEST_STIPPLE - } - - [CCode (cname = "xcb_kb_t", has_type_id = false)] - public enum KB { - KEY_CLICK_PERCENT, - BELL_PERCENT, - BELL_PITCH, - BELL_DURATION, - LED, - LED_MODE, - KEY, - AUTO_REPEAT_MODE - } - - [CCode (cname = "xcb_led_mode_t", has_type_id = false)] - public enum LedMode { - OFF, - ON - } - - [CCode (cname = "xcb_auto_repeat_mode_t", has_type_id = false)] - public enum AutoRepeatMode { - OFF, - ON, - DEFAULT - } - - [CCode (cname = "xcb_set_mode_t", has_type_id = false)] - public enum SetMode { - INSERT, - DELETE - } - - [CCode (cname = "xcb_host_mode_t", has_type_id = false)] - public enum HostMode { - INSERT, - DELETE - } - - [CCode (cname = "xcb_family_t", has_type_id = false)] - public enum Family { - INTERNET, - DECNET, - CHAOS, - SERVER_INTERPRETED, - INTERNET_6 - } - - [CCode (cname = "xcb_access_control_t", has_type_id = false)] - public enum AccessControl { - DISABLE, - ENABLE - } - - [CCode (cname = "xcb_close_down_t", has_type_id = false)] - public enum CloseDown { - DESTROY_ALL, - RETAIN_PERMANENT, - RETAIN_TEMPORARY - } - - [CCode (cname = "xcb_screen_saver_t", has_type_id = false)] - public enum ScreenSaver { - RESET, - ACTIVE - } - - [Compact] - [CCode (cname = "xcb_str_t", ref_function = "", unref_function = "")] - private class Str { - private uint8 name_len; - [CCode (cname = "xcb_str_name")] - private unowned string vala_name (); - public string name { owned get { return "%.*s".printf (name_len, vala_name ()); } } - } - - [SimpleType] - [CCode (cname = "xcb_str_iterator_t", has_type_id = false)] - private struct StrIterator { - public unowned Str data; - public int rem; - public int index; - [CCode (cname = "xcb_str_next")] - public static void next (ref StrIterator iter); - } - - [Compact] - [CCode (cname = "xcb_host_t", ref_function = "", unref_function = "")] - public class Host { - public Family family; - private uint16 address_len; - [CCode (cname = "xcb_host_address")] - public unowned uint8* vala_address (); - public unowned uint8[] address { - get { - unowned uint8[] res = (uint8[]) vala_address (); - res.length = address_len; - return res; - } - } - } - - [SimpleType] - [CCode (cname = "xcb_host_iterator_t", has_type_id = false)] - private struct HostIterator { - public unowned Host data; - public int rem; - public int index; - [CCode (cname = "xcb_host_next")] - public static void next (ref HostIterator iter); - } - - [SimpleType] - [CCode (cname = "xcb_fontprop_t", has_type_id = false)] - public struct Fontprop { - public Atom name; - public uint32 value; - } - - [Compact] - [CCode (cname = "xcb_fontprop_t", ref_function = "", unref_function = "")] - public class Charinfo { - public int16 left_side_bearing; - public int16 right_side_bearing; - public int16 character_width; - public int16 ascent; - public int16 descent; - public uint16 attributes; - } - - [SimpleType] - [CCode (cname = "xcb_fontprop_iterator_t", has_type_id = false)] - private struct FontpropIterator { - public unowned Fontprop data; - public int rem; - public int index; - [CCode (cname = "xcb_fontprop_next")] - public static void next (ref FontpropIterator iter); - } - - [CCode (cprefix = "xcb_big_requests_", cheader_filename = "xcb/bigreq.h")] - namespace BigRequests { - public static Connection get_connection (Xcb.Connection c) { - return (Connection) c; - } - - [Compact] - [CCode (cname = "xcb_connection_t", cprefix = "xcb_big_requests_", unref_function = "")] - public class Connection : Xcb.Connection { - public EnableCookie enable (); - public EnableCookie enable_unchecked (); - public EnableReply? enable_reply (EnableCookie cookie, out GenericError? e = null); - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_big_requests_enable_cookie_t", has_type_id = false)] - public struct EnableCookie { - } - - [Compact] - [CCode (cname = "xcb_big_requests_enable_reply_t", ref_function = "", unref_function = "free")] - public class EnableReply : GenericReply { - public uint32 maximum_request_length; - } - } - - [CCode (cprefix = "xcb_xc_misc_", cheader_filename = "xcb/xc_misc.h")] - namespace XCMisc { - public static Connection get_connection (Xcb.Connection c) { - return (Connection) c; - } - - [Compact] - [CCode (cname = "xcb_connection_t", cprefix = "xcb_xc_misc_", unref_function = "")] - public class Connection : Xcb.Connection { - public GetVersionCookie get_version (uint16 client_major_version, uint16 client_minor_version); - public GetVersionCookie get_version_unchecked (uint16 client_major_version, uint16 client_minor_version); - public GetVersionReply? get_version_reply (GetVersionCookie cookie, out GenericError? e = null); - - public GetXIDRangeCookie get_xid_range (); - public GetXIDRangeCookie get_xid_range_unchecked (); - public GetXIDRangeReply? get_xid_range_reply (GetXIDRangeCookie cookie, out GenericError? e = null); - - public GetXIDListCookie get_xid_list (uint32 count); - public GetXIDListCookie get_xid_list_unchecked (uint32 count); - public GetXIDListReply? get_xid_list_reply (GetXIDListCookie cookie, out GenericError? e = null); - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_xc_misc_get_version_cookie_t", has_type_id = false, cheader_filename = "xcb/xc_misc.h")] - public struct GetVersionCookie { - } - - [Compact] - [CCode (cname = "xcb_xc_misc_get_version_reply_t", ref_function = "", unref_function = "free", cheader_filename = "xcb/xc_misc.h")] - public class GetVersionReply : GenericReply { - public uint32 server_major_version; - public uint32 server_minor_version; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_xc_misc_get_xid_range_cookie_t", has_type_id = false, cheader_filename = "xcb/xc_misc.h")] - public struct GetXIDRangeCookie { - } - - [Compact] - [CCode (cname = "xcb_xc_misc_get_xid_range_reply_t", ref_function = "", unref_function = "free", cheader_filename = "xcb/xc_misc.h")] - public class GetXIDRangeReply : GenericReply { - public uint32 start_id; - public uint32 count; - } - - [SimpleType] - [IntegerType (rank = 9)] - [CCode (cname = "xcb_xc_misc_get_xid_list_cookie_t", has_type_id = false, cheader_filename = "xcb/xc_misc.h")] - public struct GetXIDListCookie { - } - - [Compact] - [CCode (cname = "xcb_xc_misc_get_xid_list_reply_t", ref_function = "", unref_function = "free", cheader_filename = "xcb/xc_misc.h")] - public class GetXIDListReply : GenericReply { - private uint32 ids_len; - [CCode (cname = "xcb_xc_misc_get_xid_list_ids")] - private uint32* vala_ids (); - public unowned uint32[] ids - { - get - { - unowned uint32[] res = (uint32[]) vala_ids (); - res.length = (int) ids_len; - return res; - } - } - } - } -} diff -Nru deepin-terminal-3.0.3+ds/widget/about_dialog.vala deepin-terminal-3.0.7/widget/about_dialog.vala --- deepin-terminal-3.0.3+ds/widget/about_dialog.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/about_dialog.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -27,34 +27,34 @@ namespace Widgets { public class AboutDialog : Widgets.Dialog { public Gtk.Widget? focus_widget; - + public AboutDialog(Gtk.Widget? widget) { focus_widget = widget; - + var overlay = new Gtk.Overlay(); var close_button = Widgets.create_close_button(); close_button.clicked.connect((b) => { this.destroy(); }); - + destroy.connect((w) => { if (focus_widget != null) { focus_widget.grab_focus(); } }); - + var button_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); button_box.pack_start(close_button, true, true, 0); var box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); box.pack_start(button_box, false, false, 0); - + var about_widget = new AboutWidget(); box.pack_start(about_widget, true, true, 0); - + set_init_size(500, 460); - + int about_text_height = Draw.get_text_render_height( about_widget, about_widget.about_text, @@ -66,7 +66,7 @@ Pango.Alignment.LEFT, "top", window_init_width - about_widget.about_x * 2); - + window_init_height += about_text_height; var event_area = new Widgets.WindowEventArea(this); @@ -76,11 +76,11 @@ } else { event_area.margin_bottom = window_init_height - Constant.TITLEBAR_HEIGHT; } - + overlay.add(box); overlay.add_overlay(event_area); - + add_widget(overlay); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/about_widget.vala deepin-terminal-3.0.7/widget/about_widget.vala --- deepin-terminal-3.0.3+ds/widget/about_widget.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/about_widget.vala 2018-10-06 18:03:56.000000000 +0000 @@ -102,7 +102,7 @@ // Draw version. cr.set_source_rgba(0.4, 0.4, 0.4, 1); - Draw.draw_text(cr, "%s V%s".printf(_("Version:"), Constant.VERSION), 0, version_y, rect.width, version_height, version_size, Pango.Alignment.CENTER, "top"); + Draw.draw_text(cr, "%s %s".printf(_("Version:"), Constant.VERSION), 0, version_y, rect.width, version_height, version_size, Pango.Alignment.CENTER, "top"); // Draw logo. Draw.draw_surface(cr, logo_surface, (rect.width - logo_surface.get_width() / get_scale_factor()) / 2, logo_y); @@ -116,4 +116,4 @@ return true; } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/add_button.vala deepin-terminal-3.0.7/widget/add_button.vala --- deepin-terminal-3.0.3+ds/widget/add_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/add_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -31,7 +31,7 @@ public AddButton(string button_name) { set_label("+ %s".printf(button_name)); set_size_request(-1, height); - + realize.connect((w) => { bool is_light_theme = ((Widgets.ConfigWindow) get_toplevel()).is_light_theme(); if (is_light_theme) { @@ -42,4 +42,4 @@ }); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/appbar.vala deepin-terminal-3.0.7/widget/appbar.vala --- deepin-terminal-3.0.3+ds/widget/appbar.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/appbar.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -32,7 +32,7 @@ namespace Widgets { public class Appbar : Gtk.Overlay { - public int height = Constant.TITLEBAR_HEIGHT; + public int height = Constant.TITLEBAR_HEIGHT; public Box max_toggle_box; public Box window_button_box; public Box window_close_button_box; @@ -50,19 +50,19 @@ public WorkspaceManager workspace_manager; public int logo_width = 48; public int titlebar_right_cache_width = 10; - + public signal void close_window(); public signal void exit_terminal(); public signal void quit_fullscreen(); - + public Appbar(TerminalApp app, Widgets.Window win, Tabbar tab_bar, WorkspaceManager manager, bool has_start) { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); window = win; workspace_manager = manager; - - set_size_request(-1, height); - + + set_size_request(-1, height); + if (has_start) { // If has one terminal start, // just call *first* temrinal's 'exit' function, then *first* terminal process will broadcast 'quit' signal, @@ -85,7 +85,7 @@ }); } catch (IOError e) { stderr.printf("AppBar bus own: %s\n", e.message); - } + } } else { // If current temrinal is *first* one, // broadcast 'quit' signal to other terminals and quit itself. @@ -93,29 +93,29 @@ app.exit(); }); } - + tabbar = tab_bar; - + window_button_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); window_close_button_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); - + menu_button = new WindowButton("window_menu", true, Constant.WINDOW_BUTTON_WIDHT, Constant.TITLEBAR_HEIGHT); min_button = new WindowButton("window_min", true, Constant.WINDOW_BUTTON_WIDHT, Constant.TITLEBAR_HEIGHT); max_button = new WindowButton("window_max", true, Constant.WINDOW_BUTTON_WIDHT, Constant.TITLEBAR_HEIGHT); unmax_button = new WindowButton("window_unmax", true, Constant.WINDOW_BUTTON_WIDHT, Constant.TITLEBAR_HEIGHT); close_button = new WindowButton("window_close", true, Constant.WINDOW_BUTTON_WIDHT + Constant.CLOSE_BUTTON_MARGIN_RIGHT, Constant.TITLEBAR_HEIGHT); quit_fullscreen_button = new WindowButton("quit_fullscreen", true, Constant.WINDOW_BUTTON_WIDHT + Constant.CLOSE_BUTTON_MARGIN_RIGHT, Constant.TITLEBAR_HEIGHT); - + close_button.clicked.connect((w) => { close_window(); }); quit_fullscreen_button.clicked.connect((w) => { quit_fullscreen(); }); - + menu_button.clicked.connect((b) => { focus_widget = ((Gtk.Window) menu_button.get_toplevel()).get_focus(); - + var menu_content = new List(); menu_content.append(new Menu.MenuItem("new_window", _("New window"))); menu_content.append(new Menu.MenuItem("switch_theme", _("Switch theme"))); @@ -128,21 +128,21 @@ } menu_content.append(new Menu.MenuItem("about", _("About"))); menu_content.append(new Menu.MenuItem("exit", _("Exit"))); - + int menu_x, menu_y; menu_button.translate_coordinates(menu_button.get_toplevel(), 0, 0, out menu_x, out menu_y); Gtk.Allocation menu_rect; menu_button.get_allocation(out menu_rect); int window_x, window_y; menu_button.get_toplevel().get_window().get_origin(out window_x, out window_y); - + menu = new Menu.Menu(window_x + menu_x, window_y + menu_y + menu_rect.height, menu_content); menu.click_item.connect(handle_menu_item_click); menu.destroy.connect(handle_menu_destroy); }); - + max_toggle_box = new Box(Gtk.Orientation.HORIZONTAL, 0); - + min_button.clicked.connect((w, e) => { ((Gtk.Window) w.get_toplevel()).iconify(); }); @@ -152,15 +152,15 @@ unmax_button.clicked.connect((w, e) => { ((Gtk.Window) w.get_toplevel()).unmaximize(); }); - + Box box = new Box(Gtk.Orientation.HORIZONTAL, 0); - - var logo_box = new Box(Gtk.Orientation.VERTICAL, 0); - logo_box.set_size_request(logo_width, Constant.TITLEBAR_HEIGHT); - Gtk.Image logo_image = new Gtk.Image.from_file(Utils.get_image_path("title_icon.svg")); - logo_box.pack_start(logo_image, true, true, 0); - box.pack_start(logo_box, false, false, 0); - + + var logo_box = new Box(Gtk.Orientation.VERTICAL, 0); + logo_box.set_size_request(logo_width, Constant.TITLEBAR_HEIGHT); + Gtk.Image logo_image = new Gtk.Image.from_file(Utils.get_image_path("title_icon.svg")); + logo_box.pack_start(logo_image, true, true, 0); + box.pack_start(logo_box, false, false, 0); + max_toggle_box.add(max_button); box.pack_start(tabbar, true, true, 0); @@ -169,28 +169,28 @@ box.pack_start(cache_area, false, false, 0); box.pack_start(window_button_box, false, false, 0); box.pack_start(window_close_button_box, false, false, 0); - + show_window_button(); - + event_area = new Widgets.WindowEventArea(this); // Don't override window button area. event_area.margin_end = Constant.CLOSE_BUTTON_WIDTH * 4; event_area.filter_double_click_callback = ((x, y) => { int tabbar_x, tabbar_y; this.translate_coordinates(tabbar, x, y, out tabbar_x, out tabbar_y); - + return tabbar.is_at_tab_close_button((int) tabbar_x) != -1; }); - + add(box); add_overlay(event_area); - + Gdk.RGBA background_color = Gdk.RGBA(); - + box.draw.connect((w, cr) => { Gtk.Allocation rect; w.get_allocation(out rect); - + try { background_color = Utils.hex_to_rgba(window.config.config_file.get_string("theme", "background")); if (window.window_is_fullscreen()) { @@ -202,31 +202,31 @@ } catch (Error e) { print("Main window: %s\n", e.message); } - + Utils.propagate_draw((Container) w, cr); return true; }); } - + public void show_window_button() { window_button_box.pack_start(menu_button, false, false, 0); window_button_box.pack_start(min_button, false, false, 0); window_button_box.pack_start(max_toggle_box, false, false, 0); - + Utils.remove_all_children(window_close_button_box); window_close_button_box.pack_start(close_button, false, false, 0); - + show_all(); } - + public void hide_window_button() { Utils.remove_all_children(window_button_box); Utils.remove_all_children(window_close_button_box); - + window_close_button_box.pack_start(quit_fullscreen_button, false, false, 0); } - + public void handle_menu_item_click(string item_id) { switch(item_id) { case "new_window": @@ -236,7 +236,7 @@ } catch (GLib.Error e) { print("Appbar menu item 'new window': %s\n", e.message); } - break; + break; case "custom_commands": workspace_manager.focus_workspace.show_command_panel(workspace_manager.focus_workspace); break; @@ -246,42 +246,42 @@ case "switch_theme": workspace_manager.focus_workspace.show_theme_panel(workspace_manager.focus_workspace); break; - case "help": + case "help": Utils.show_manual(); - break; - case "about": + break; + case "about": var dialog = new AboutDialog(focus_widget); dialog.transient_for_window((Widgets.ConfigWindow) this.get_toplevel()); - break; - case "exit": + break; + case "exit": // This just call exit_terminal signal, how to exit terminal looks signal exit_terminal's hooks that define at current class. exit_terminal(); - break; + break; case "preference": var preference = new Widgets.Preference((Widgets.ConfigWindow) this.get_toplevel(), ((Gtk.Window) this.get_toplevel()).get_focus()); preference.transient_for_window((Widgets.ConfigWindow) this.get_toplevel()); break; } - } - - public void handle_menu_destroy() { - menu = null; - + } + + public void handle_menu_destroy() { + menu = null; + if (focus_widget != null) { focus_widget.grab_focus(); } } - + public void update_max_button() { Utils.remove_all_children(max_toggle_box); - + if (((Widgets.Window) get_toplevel()).window_is_max()) { max_toggle_box.add(unmax_button); } else { max_toggle_box.add(max_button); } - + max_toggle_box.show_all(); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/base_panel.vala deepin-terminal-3.0.7/widget/base_panel.vala --- deepin-terminal-3.0.3+ds/widget/base_panel.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/base_panel.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,14 +19,14 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; namespace Widgets { public class BasePanel : Gtk.HBox { - public Widgets.ConfigWindow parent_window; - public WorkspaceManager workspace_manager; + public Widgets.ConfigWindow parent_window; + public WorkspaceManager workspace_manager; public Gdk.RGBA background_color; public Gdk.RGBA line_dark_color; public Gdk.RGBA line_light_color; @@ -39,15 +39,15 @@ public Workspace workspace; public int back_button_margin_left = 8; public int back_button_margin_top = 6; - + public BasePanel() { home_page_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); search_page_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); - + line_dark_color = Utils.hex_to_rgba("#ffffff", 0.1); line_light_color = Utils.hex_to_rgba("#000000", 0.1); } - + public Gtk.ScrolledWindow create_scrolled_window() { var scrolledwindow = new ScrolledWindow(null, null); scrolledwindow.get_style_context().add_class("scrolledwindow"); @@ -57,84 +57,84 @@ return scrolledwindow; } - + public void update_search_page(string search_text, string group_name) { double scroll_value = 0; if (search_page_scrolledwindow != null) { scroll_value = search_page_scrolledwindow.get_vadjustment().get_value(); } - - create_search_page(search_text, group_name); - + + create_search_page(search_text, group_name); + switcher.add_to_left_box(search_page_box); if (search_page_scrolledwindow != null) { search_page_scrolledwindow.get_vadjustment().set_value(scroll_value); } - + show_all(); } - - public void show_home_page(Gtk.Widget? start_widget=null) { + + public void show_home_page(Gtk.Widget? start_widget=null) { create_home_page(); - + if (start_widget == null) { switcher.add_to_left_box(home_page_box); } else { switcher.scroll_to_left(start_widget, home_page_box); } - - show_all(); - } + + show_all(); + } public void show_search_page(string search_text, string group_name, Gtk.Widget start_widget) { create_search_page(search_text, group_name); switcher.scroll_to_right(start_widget, search_page_box); - + show_all(); - } + } public void update_home_page() { double scroll_value = 0; if (home_page_scrolledwindow != null) { scroll_value = home_page_scrolledwindow.get_vadjustment().get_value(); } - + create_home_page(); - + switcher.add_to_left_box(home_page_box); - + if (home_page_scrolledwindow != null) { home_page_scrolledwindow.get_vadjustment().set_value(scroll_value); } - + show_all(); } - - public bool on_draw(Gtk.Widget widget, Cairo.Context cr) { + + public bool on_draw(Gtk.Widget widget, Cairo.Context cr) { bool is_light_theme = ((Widgets.ConfigWindow) get_toplevel()).is_light_theme(); - + Gtk.Allocation rect; widget.get_allocation(out rect); - + cr.set_source_rgba(background_color.red, background_color.green, background_color.blue, 0.8); Draw.draw_rectangle(cr, 1, 0, rect.width - 1, rect.height); - + if (is_light_theme) { Utils.set_context_color(cr, line_light_color); } else { Utils.set_context_color(cr, line_dark_color); } Draw.draw_rectangle(cr, 0, 0, 1, rect.height); - + return false; } - + public virtual void create_search_page(string search_text, string group_name) { } - + public virtual void create_home_page() { } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/check_button.vala deepin-terminal-3.0.7/widget/check_button.vala --- deepin-terminal-3.0.3+ds/widget/check_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/check_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,15 +19,15 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; namespace Widgets { public class CheckButton : Gtk.CheckButton { - public bool is_hover = false; - public bool is_press = false; + public bool is_hover = false; + public bool is_press = false; public Cairo.ImageSurface checked_hover_surface; public Cairo.ImageSurface checked_insensitive_surface; public Cairo.ImageSurface checked_normal_surface; @@ -36,7 +36,7 @@ public Cairo.ImageSurface unchecked_insensitive_surface; public Cairo.ImageSurface unchecked_normal_surface; public Cairo.ImageSurface unchecked_press_surface; - + public CheckButton() { checked_normal_surface = Utils.create_image_surface("checkbox_checked_normal.svg"); checked_hover_surface = Utils.create_image_surface("checkbox_checked_hover.svg"); @@ -46,38 +46,38 @@ unchecked_hover_surface = Utils.create_image_surface("checkbox_unchecked_hover.svg"); unchecked_press_surface = Utils.create_image_surface("checkbox_unchecked_press.svg"); unchecked_insensitive_surface = Utils.create_image_surface("checkbox_unchecked_insensitive.svg"); - - set_size_request(checked_normal_surface.get_width() / get_scale_factor(), + + set_size_request(checked_normal_surface.get_width() / get_scale_factor(), checked_normal_surface.get_height() / get_scale_factor()); - + draw.connect(on_draw); - enter_notify_event.connect((w, e) => { - is_hover = true; - queue_draw(); - - return false; - }); - leave_notify_event.connect((w, e) => { - is_hover = false; - queue_draw(); - - return false; - }); - button_press_event.connect((w, e) => { - is_press = true; - queue_draw(); - - return false; - }); - button_release_event.connect((w, e) => { - is_hover = false; - is_press = false; - queue_draw(); - - return false; - }); + enter_notify_event.connect((w, e) => { + is_hover = true; + queue_draw(); + + return false; + }); + leave_notify_event.connect((w, e) => { + is_hover = false; + queue_draw(); + + return false; + }); + button_press_event.connect((w, e) => { + is_press = true; + queue_draw(); + + return false; + }); + button_release_event.connect((w, e) => { + is_hover = false; + is_press = false; + queue_draw(); + + return false; + }); } - + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { if (get_sensitive()) { if (get_active()) { @@ -104,8 +104,8 @@ Draw.draw_surface(cr, unchecked_insensitive_surface); } } - + return true; } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/click_event_box.vala deepin-terminal-3.0.7/widget/click_event_box.vala --- deepin-terminal-3.0.3+ds/widget/click_event_box.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/click_event_box.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,33 +19,33 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Utils; namespace Widgets { public class ClickEventBox : Gtk.EventBox { - public bool is_press = false; - - public signal void clicked(Gdk.EventButton event); + public bool is_press = false; + + public signal void clicked(Gdk.EventButton event); public ClickEventBox() { - button_press_event.connect((w, e) => { - is_press = true; - - return false; - }); - - button_release_event.connect((w, e) => { + button_press_event.connect((w, e) => { + is_press = true; + + return false; + }); + + button_release_event.connect((w, e) => { if (is_press && Utils.is_left_button(e) && Utils.pointer_in_widget_area(this)) { clicked(e); } - - is_press = false; - - return false; - }); + + is_press = false; + + return false; + }); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/command_button.vala deepin-terminal-3.0.7/widget/command_button.vala --- deepin-terminal-3.0.3+ds/widget/command_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/command_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -28,10 +28,10 @@ public class CommandButton : Widgets.PanelButton { public signal void edit_command(string command_name); public signal void execute_command(string command_value); - + public CommandButton(string name, string value, string shortcut) { base(name, shortcut, null, "command"); - + click_edit_button.connect((w) => { edit_command(name); }); @@ -40,4 +40,4 @@ }); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/command_dialog.vala deepin-terminal-3.0.7/widget/command_dialog.vala --- deepin-terminal-3.0.3+ds/widget/command_dialog.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/command_dialog.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -60,7 +60,7 @@ public int preference_widget_width = 300; public int window_expand_height = 330; public string? command_info; - + public signal void add_command(string name, string command, string shortcut @@ -69,14 +69,14 @@ string command, string shortcut ); - + public signal void delete_command(string name); - + public CommandDialog(Widgets.ConfigWindow window, Term? term, Gtk.Widget? widget, string? info=null, KeyFile? config_file=null) { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); - + set_init_size(480, 320); - + var font_description = new Pango.FontDescription(); font_description.set_size((int)(font_size * Pango.SCALE)); int max_width = 0; @@ -90,61 +90,61 @@ max_width = int.max(max_width, name_width); } preference_name_width = max_width + preference_name_margin_left; - + try { parent_window = window; focus_term = term; focus_widget = widget; command_info = info; - + box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); - + var top_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); top_box.margin_bottom = preference_margin_top; - + var event_area = new Widgets.WindowEventArea(this); event_area.margin_end = Constant.CLOSE_BUTTON_WIDTH; - + var overlay = new Gtk.Overlay(); overlay.add(top_box); overlay.add_overlay(event_area); - + box.pack_start(overlay, false, false, 0); - + // Make label center of titlebar. var spacing_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); spacing_box.set_size_request(Constant.CLOSE_BUTTON_WIDTH, -1); top_box.pack_start(spacing_box, false, false, 0); - + Gtk.Label title_label = new Gtk.Label(null); title_label.get_style_context().add_class("remote_server_label"); top_box.pack_start(title_label, true, true, 0); - + if (command_info != null) { title_label.set_text(_("Edit Command")); } else { title_label.set_text(_("Add Command")); } - + var close_button = Widgets.create_close_button(); close_button.clicked.connect((b) => { this.destroy(); }); - + top_box.pack_start(close_button, false, false, 0); - + destroy.connect((w) => { if (focus_widget != null) { focus_widget.grab_focus(); } }); - + content_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); content_box.set_halign(Gtk.Align.CENTER); content_box.margin_start = preference_margin_start; content_box.margin_end = preference_margin_end; box.pack_start(content_box, false, false, 0); - + var grid = new Gtk.Grid(); grid.margin_end = label_margin_left; content_box.pack_start(grid, false, false, 0); @@ -178,15 +178,15 @@ shortcut_entry.set_text(config_file.get_value(command_info, "Shortcut")); } create_follow_key_row(shortcut_label, shortcut_entry, _("Shortcuts:"), command_label, grid); - + command_action_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); command_action_box.set_size_request(-1, 30); content_box.pack_start(command_action_box, false, false, 0); - + if (command_info != null) { add_delete_button(); } - + Box button_box = new Box(Gtk.Orientation.HORIZONTAL, 0); button_box.margin_top = action_button_margin_top; DialogButton cancel_button = new Widgets.DialogButton(_("Cancel"), "left", "text", parent_window.screen_monitor.is_composited()); @@ -217,37 +217,37 @@ } } }); - + var tab_order_list = new List(); tab_order_list.append((Gtk.Widget) cancel_button); tab_order_list.append((Gtk.Widget) confirm_button); button_box.set_focus_chain(tab_order_list); button_box.set_focus_child(confirm_button); - + button_box.pack_start(cancel_button, true, true, 0); button_box.pack_start(confirm_button, true, true, 0); box.pack_start(button_box, false, false, 0); - + add_widget(box); } catch (Error e) { error ("%s", e.message); } } - + public void add_delete_button() { delete_command_button = Widgets.create_delete_button(_("Delete command")); delete_command_button.clicked.connect((w) => { this.hide(); - + var command_name = name_entry.get_text(); if (command_name.length > max_command_name_length) { - command_name = command_name.substring(0, max_command_name_length) + " ... "; + command_name = command_name.substring(0, max_command_name_length) + " ... "; } - + var confirm_dialog = new Widgets.ConfirmDialog( - _("Delete command"), - "%s %s?".printf(_("Are you sure to delete"), command_name), - _("Cancel"), + _("Delete command"), + "%s %s?".printf(_("Are you sure to delete"), command_name), + _("Cancel"), _("Delete")); confirm_dialog.transient_for_window(parent_window); confirm_dialog.cancel.connect((w) => { @@ -260,22 +260,22 @@ }); command_action_box.pack_start(delete_command_button, true, true, 0); - + command_action_box.show_all(); } - + public Label create_label(string text) { Label label = new Gtk.Label(null); label.margin_start = label_margin_left; label.set_text(text); label.get_style_context().add_class("preference_label"); label.set_xalign(0); - + return label; } - + public void create_key_row(Gtk.Label label, Gtk.Widget widget, string name, Gtk.Grid grid, string class_name="preference_entry") { - label.set_text(name); + label.set_text(name); label.margin_start = label_margin_left; label.get_style_context().add_class("preference_label"); widget.get_style_context().add_class(class_name); @@ -284,28 +284,28 @@ adjust_option_widgets(label, widget); grid_attach(grid, label, 0, 0, preference_name_width, grid_height); grid_attach_next_to(grid, widget, label, Gtk.PositionType.RIGHT, preference_widget_width, grid_height); - } - + } + public void create_follow_key_row(Gtk.Label label, Gtk.Widget widget, string name, Gtk.Label previous_label, Gtk.Grid grid, string class_name="preference_entry") { - label.set_text(name); + label.set_text(name); label.margin_start = label_margin_left; label.get_style_context().add_class("preference_label"); widget.get_style_context().add_class(class_name); widget.margin_start = label_margin_left; - + adjust_option_widgets(label, widget); grid_attach_next_to(grid, label, previous_label, Gtk.PositionType.BOTTOM, preference_name_width, grid_height); grid_attach_next_to(grid, widget, label, Gtk.PositionType.RIGHT, preference_widget_width, grid_height); - } - + } + public void adjust_option_widgets(Gtk.Label name_widget, Gtk.Widget value_widget) { name_widget.set_xalign(0); name_widget.set_size_request(preference_name_width, grid_height); - + value_widget.set_size_request(preference_widget_width, grid_height); // NOTE: // set_hexpand is very important to make widget in grid to expand space horizaontally. value_widget.set_hexpand(true); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/command_panel.vala deepin-terminal-3.0.7/widget/command_panel.vala --- deepin-terminal-3.0.3+ds/widget/command_panel.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/command_panel.vala 2018-10-06 18:03:56.000000000 +0000 @@ -299,7 +299,7 @@ public void execute_command(string command) { Term focus_term = workspace_manager.focus_workspace.get_focus_term(workspace_manager.focus_workspace); var command_string = "%s\n".printf(command); - focus_term.term.feed_child(command_string, command_string.length); + focus_term.term.feed_child(command_string.to_utf8()); workspace.hide_command_panel(); if (focus_widget != null) { @@ -324,4 +324,4 @@ return add_command_button; } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/config_window.vala deepin-terminal-3.0.7/widget/config_window.vala --- deepin-terminal-3.0.3+ds/widget/config_window.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/config_window.vala 2018-10-06 18:03:56.000000000 +0000 @@ -46,12 +46,12 @@ public int reset_timeout_delay = 150; public int resize_cache_x = 0; public int resize_cache_y = 0; - public int resize_cache_width = 0; - public int resize_cache_height = 0; + public int resize_cache_width = 0; + public int resize_cache_height = 0; public int resize_timeout_delay = 150; public uint? reset_timeout_source_id = null; public uint? resize_timeout_source_id = null; - + private bool is_show_shortcut_viewer = false; public ConfigWindow() { @@ -201,8 +201,8 @@ cache_width = width; cache_height = height; } - - return false; + + return false; }); init_active_tab_underline(tabbar); @@ -442,9 +442,9 @@ if (keyname == "F1") { Utils.show_manual(); - - return true; - } + + return true; + } var search_key = config.config_file.get_string("shortcut", "search"); if (search_key != "" && keyname == search_key) { @@ -534,12 +534,12 @@ } return true; } - + var rename_title_key = config.config_file.get_string("shortcut", "rename_title"); if (rename_title_key != "" && keyname == rename_title_key) { Term focus_term = workspace_manager.focus_workspace.get_focus_term(workspace_manager.focus_workspace); focus_term.rename_title(); - + return true; } @@ -596,17 +596,17 @@ workspace_manager.switch_workspace_with_index(int.parse(Keymap.get_key_name(key_event.keyval))); return true; } - + if (keyname in new_terminal_shortcuts) { var theme_name = config.config_file.get_string("theme_terminal", "theme%i".printf(int.parse(Keymap.get_key_name(key_event.keyval)))); - + try { GLib.AppInfo appinfo = GLib.AppInfo.create_from_commandline("deepin-terminal --load-theme '%s'".printf(theme_name), null, GLib.AppInfoCreateFlags.NONE); appinfo.launch(null, null); } catch (GLib.Error e) { print("Appbar menu item 'new window': %s\n", e.message); } - + return true; } @@ -722,4 +722,4 @@ return !window_is_max() && !window_is_fullscreen() && !window_is_tiled(); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/confirm_dialog.vala deepin-terminal-3.0.7/widget/confirm_dialog.vala --- deepin-terminal-3.0.3+ds/widget/confirm_dialog.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/confirm_dialog.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -35,35 +35,34 @@ private int logo_margin_end = 20; private int logo_margin_start = 20; private int title_margin_top = 7; - + public signal void cancel(); public signal void confirm(); - + public ConfirmDialog(string title, string content, string cancel_text, string confirm_text) { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); - + set_init_size(480, 230); - + // Add widgets. var overlay = new Gtk.Overlay(); var box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); - + var close_button = Widgets.create_close_button(); close_button.clicked.connect((b) => { this.destroy(); }); var close_button_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); - close_button_box.pack_start(close_button, true, true, 0); var content_button_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); content_button_box.margin_top = box_margin_top; content_button_box.margin_bottom = box_margin_bottom; content_button_box.margin_end = box_margin_end; - + Gtk.Image logo_image = new Gtk.Image.from_file(Utils.get_image_path("dialog_icon.svg")); logo_image.margin_start = logo_margin_start; logo_image.margin_end = logo_margin_end; - + var label_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); Label title_label = new Gtk.Label(null); title_label.set_halign(Gtk.Align.START); @@ -76,7 +75,7 @@ content_label.get_style_context().add_class("dialog_content"); content_label.set_text(content); content_label.margin_top = content_margin_top; - + Box button_box = new Box(Gtk.Orientation.HORIZONTAL, 0); if (cancel_text != "") { cancel_button = new Widgets.DialogButton(cancel_text, "left", "text", screen_monitor.is_composited()); @@ -94,7 +93,7 @@ confirm(); destroy(); }); - + var tab_order_list = new List(); if (cancel_text != "") { tab_order_list.append((Gtk.Widget) cancel_button); @@ -102,7 +101,7 @@ tab_order_list.append((Gtk.Widget) confirm_button); button_box.set_focus_chain(tab_order_list); button_box.set_focus_child(confirm_button); - + close_button_box.pack_start(close_button, true, true, 0); label_box.pack_start(title_label, false, false, 0); label_box.pack_start(content_label, false, false, 0); @@ -115,14 +114,14 @@ box.pack_start(close_button_box, false, false, 0); box.pack_start(content_button_box, true, true, 0); box.pack_start(button_box, true, true, 0); - + var event_area = new Widgets.WindowEventArea(this); event_area.margin_end = Constant.CLOSE_BUTTON_WIDTH; event_area.margin_bottom = Constant.DIALOG_BUTTON_HEIGHT; - + overlay.add(box); overlay.add_overlay(event_area); - + add_widget(overlay); } } @@ -130,7 +129,7 @@ public ConfirmDialog create_running_confirm_dialog(Widgets.ConfigWindow window) { ConfirmDialog dialog = new ConfirmDialog(_("Programs are still running in terminal"), _("Are you sure to exit?"), _("Cancel"), _("Exit")); dialog.transient_for_window(window); - + return dialog; } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/cursor_toggle_button.vala deepin-terminal-3.0.7/widget/cursor_toggle_button.vala --- deepin-terminal-3.0.3+ds/widget/cursor_toggle_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/cursor_toggle_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,120 +19,120 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; namespace Widgets { - public class CursorToggleButton : Gtk.Bin { + public class CursorToggleButton : Gtk.Bin { public CursorStyleButton block_button; - public CursorStyleButton ibeam_button; - public CursorStyleButton underline_button; - public int cursor_height = 26; - public int cursor_width = 36; - - public signal void change_cursor_state(string active_state); - - public CursorToggleButton() { - set_size_request(cursor_width, cursor_height * 3); - - var box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); - - block_button = new CursorStyleButton("cursor_block"); - ibeam_button = new CursorStyleButton("cursor_ibeam"); - underline_button = new CursorStyleButton("cursor_underline"); - - block_button.active.connect((w) => { - set_cursor_state("block"); - change_cursor_state("block"); - }); - - ibeam_button.active.connect((w) => { - set_cursor_state("ibeam"); - change_cursor_state("ibeam"); - }); - - underline_button.active.connect((w) => { - set_cursor_state("underline"); - change_cursor_state("underline"); - }); - - box.pack_start(block_button, false, false, 0); - box.pack_start(ibeam_button, false, false, 0); - box.pack_start(underline_button, false, false, 0); - - this.add(box); - - show_all(); - } - - public void set_cursor_state(string name) { - if (name == "block") { - block_button.set_active(true); - ibeam_button.set_active(false); - underline_button.set_active(false); - } else if (name == "ibeam") { - block_button.set_active(false); - ibeam_button.set_active(true); - underline_button.set_active(false); - } else if (name == "underline") { - block_button.set_active(false); - ibeam_button.set_active(false); - underline_button.set_active(true); - } - } - } - - public class CursorStyleButton : Gtk.Button { - public bool is_active = false; - public int cursor_width = 36; - public int cursor_height = 26; - + public CursorStyleButton ibeam_button; + public CursorStyleButton underline_button; + public int cursor_height = 26; + public int cursor_width = 36; + + public signal void change_cursor_state(string active_state); + + public CursorToggleButton() { + set_size_request(cursor_width, cursor_height * 3); + + var box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); + + block_button = new CursorStyleButton("cursor_block"); + ibeam_button = new CursorStyleButton("cursor_ibeam"); + underline_button = new CursorStyleButton("cursor_underline"); + + block_button.active.connect((w) => { + set_cursor_state("block"); + change_cursor_state("block"); + }); + + ibeam_button.active.connect((w) => { + set_cursor_state("ibeam"); + change_cursor_state("ibeam"); + }); + + underline_button.active.connect((w) => { + set_cursor_state("underline"); + change_cursor_state("underline"); + }); + + box.pack_start(block_button, false, false, 0); + box.pack_start(ibeam_button, false, false, 0); + box.pack_start(underline_button, false, false, 0); + + this.add(box); + + show_all(); + } + + public void set_cursor_state(string name) { + if (name == "block") { + block_button.set_active(true); + ibeam_button.set_active(false); + underline_button.set_active(false); + } else if (name == "ibeam") { + block_button.set_active(false); + ibeam_button.set_active(true); + underline_button.set_active(false); + } else if (name == "underline") { + block_button.set_active(false); + ibeam_button.set_active(false); + underline_button.set_active(true); + } + } + } + + public class CursorStyleButton : Gtk.Button { + public bool is_active = false; + public int cursor_width = 36; + public int cursor_height = 26; + Cairo.ImageSurface normal_surface; Cairo.ImageSurface hover_surface; Cairo.ImageSurface press_surface; Cairo.ImageSurface checked_surface; - - public signal void active(); - - public CursorStyleButton(string icon_name) { - set_size_request(cursor_width, cursor_height); - + + public signal void active(); + + public CursorStyleButton(string icon_name) { + set_size_request(cursor_width, cursor_height); + normal_surface = Utils.create_image_surface(icon_name + "_normal.svg"); hover_surface = Utils.create_image_surface(icon_name + "_hover.svg"); press_surface = Utils.create_image_surface(icon_name + "_press.svg"); checked_surface = Utils.create_image_surface(icon_name + "_checked.svg"); - - button_press_event.connect((w) => { - active(); - - return false; - }); - - draw.connect(on_draw); - } - - public void set_active(bool active) { - is_active = active; - - queue_draw(); - } - - private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { - var state_flags = widget.get_state_flags(); - - if (is_active) { - Draw.draw_surface(cr, checked_surface); - } else if ((state_flags & Gtk.StateFlags.ACTIVE) != 0) { + + button_press_event.connect((w) => { + active(); + + return false; + }); + + draw.connect(on_draw); + } + + public void set_active(bool active) { + is_active = active; + + queue_draw(); + } + + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { + var state_flags = widget.get_state_flags(); + + if (is_active) { + Draw.draw_surface(cr, checked_surface); + } else if ((state_flags & Gtk.StateFlags.ACTIVE) != 0) { Draw.draw_surface(cr, press_surface); } else if ((state_flags & Gtk.StateFlags.PRELIGHT) != 0) { Draw.draw_surface(cr, hover_surface); } else { - Draw.draw_surface(cr, normal_surface); + Draw.draw_surface(cr, normal_surface); } - + return true; - } - } -} \ No newline at end of file + } + } +} diff -Nru deepin-terminal-3.0.3+ds/widget/dialog_button.vala deepin-terminal-3.0.7/widget/dialog_button.vala --- deepin-terminal-3.0.3+ds/widget/dialog_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/dialog_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Cairo; using Draw; @@ -44,12 +44,12 @@ get_style_context().add_class("dialog_noradius_button_%s_%s".printf(direction, type)); } } - + enter_notify_event.connect((w) => { grab_focus(); - + return false; }); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/dropdown_text_button.vala deepin-terminal-3.0.7/widget/dropdown_text_button.vala --- deepin-terminal-3.0.3+ds/widget/dropdown_text_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/dropdown_text_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,19 +19,19 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; namespace Widgets { - public class DropdownTextButton : Gtk.ComboBoxText { - public DropdownTextButton() { - scroll_event.connect(on_scroll); - } - - public bool on_scroll(Gtk.Widget widget, Gdk.EventScroll scroll_event) { - return true; - } - } -} \ No newline at end of file + public class DropdownTextButton : Gtk.ComboBoxText { + public DropdownTextButton() { + scroll_event.connect(on_scroll); + } + + public bool on_scroll(Gtk.Widget widget, Gdk.EventScroll scroll_event) { + return true; + } + } +} diff -Nru deepin-terminal-3.0.3+ds/widget/encoding_button.vala deepin-terminal-3.0.7/widget/encoding_button.vala --- deepin-terminal-3.0.3+ds/widget/encoding_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/encoding_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gee; using Gtk; @@ -43,14 +43,14 @@ public int content_padding_x = 24; public int content_padding_y = 15; public string encoding_name; - + public EncodingButton(string name, Workspace space) { encoding_name = name; - + try { Widgets.ConfigWindow parent_window = (Widgets.ConfigWindow) space.get_toplevel(); var theme_name = parent_window.config.config_file.get_string("general", "theme"); - + theme_file = new KeyFile(); theme_file.load_from_file(Utils.get_theme_path(theme_name), KeyFileFlags.NONE); background_color = Utils.hex_to_rgba(theme_file.get_string("theme", "background").strip()); @@ -59,45 +59,45 @@ background_color.alpha = 0.8; foreground_color = Utils.hex_to_rgba(theme_file.get_string("theme", "foreground").strip()); content_color = Utils.hex_to_rgba(theme_file.get_string("theme", "color_2").strip()); - + dark_theme_border_surface = Utils.create_image_surface("dark_theme_border.svg"); light_theme_border_surface = Utils.create_image_surface("light_theme_border.svg"); active_theme_border_surface = Utils.create_image_surface("active_theme_border.svg"); } catch (Error e) { print("EncodingButton: %s\n", e.message); } - + visible_window = false; set_size_request(Constant.ENCODING_BUTTON_WIDTH, Constant.ENCODING_BUTTON_HEIGHT); margin_start = (Constant.ENCODING_SLIDER_WIDTH - Constant.ENCODING_BUTTON_WIDTH) / 2; margin_end = (Constant.ENCODING_SLIDER_WIDTH - Constant.ENCODING_BUTTON_WIDTH) / 2; - + draw.connect(on_draw); } - + public void active() { is_active = true; - + queue_draw(); } - + public void inactive() { is_active = false; - + queue_draw(); } - + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { Gtk.Allocation rect; widget.get_allocation(out rect); - + cr.set_source_rgba(background_color.red, background_color.green, background_color.blue, background_color.alpha); Draw.fill_rounded_rectangle(cr, background_padding, background_padding, rect.width - background_padding * 2, rect.height - background_padding * 2, button_radius); cr.set_source_rgba(content_color.red, content_color.green, content_color.blue, content_color.alpha); Draw.draw_text(cr, encoding_name, content_padding_x, content_padding_y, rect.width, rect.height, content_font_size, Pango.Alignment.LEFT, "top"); - + if (is_active) { Draw.draw_surface(cr, active_theme_border_surface); } else if (is_light_color) { @@ -105,7 +105,7 @@ } else { Draw.draw_surface(cr, dark_theme_border_surface, border_padding, border_padding); } - + return true; } } @@ -114,25 +114,25 @@ public int encoding_button_padding = Constant.ENCODING_BUTTON_PADDING; public HashMap encoding_button_map; public EncodingButton? active_encoding_button = null; - + public signal void active_encoding(string encoding_name); - + public EncodingList(string temrinal_encoding, ArrayList encoding_names, Workspace space) { encoding_button_map = new HashMap(); - + foreach (string encoding_name in encoding_names) { var button = new Widgets.EncodingButton(encoding_name, space); pack_start(button, false, false, encoding_button_padding); - + button.button_press_event.connect((w, e) => { if (Utils.is_left_button(e)) { active_button(encoding_name); active_encoding(encoding_name); } - + return false; }); - + encoding_button_map.set(encoding_name, button); } @@ -143,7 +143,7 @@ if (active_encoding_button != null) { active_encoding_button.inactive(); } - + active_encoding_button = encoding_button_map.get(encoding_name); active_encoding_button.active(); } diff -Nru deepin-terminal-3.0.3+ds/widget/encoding_panel.vala deepin-terminal-3.0.7/widget/encoding_panel.vala --- deepin-terminal-3.0.3+ds/widget/encoding_panel.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/encoding_panel.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gee; using Gtk; @@ -27,11 +27,11 @@ using Widgets; namespace Widgets { - public class EncodingPanel : Gtk.HBox { + public class EncodingPanel : Gtk.HBox { public Widgets.Switcher switcher; - public Widgets.ConfigWindow parent_window; + public Widgets.ConfigWindow parent_window; public Workspace workspace; - public WorkspaceManager workspace_manager; + public WorkspaceManager workspace_manager; public Gdk.RGBA background_color; public Gdk.RGBA line_dark_color; public Gdk.RGBA line_light_color; @@ -47,44 +47,44 @@ public int encoding_list_margin_top = 5; public int split_line_margin_left = 1; public int width = Constant.ENCODING_SLIDER_WIDTH; - + public delegate void UpdatePageAfterEdit(); - - public EncodingPanel(Workspace space, WorkspaceManager manager, Term term) { + + public EncodingPanel(Workspace space, WorkspaceManager manager, Term term) { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); - + workspace = space; - workspace_manager = manager; + workspace_manager = manager; focus_term = term; - + config_file = new KeyFile(); - + line_dark_color = Utils.hex_to_rgba("#ffffff", 0.1); line_light_color = Utils.hex_to_rgba("#000000", 0.1); - + focus_widget = ((Gtk.Window) workspace.get_toplevel()).get_focus(); - parent_window = (Widgets.ConfigWindow) workspace.get_toplevel(); - + parent_window = (Widgets.ConfigWindow) workspace.get_toplevel(); + switcher = new Widgets.Switcher(width); - + home_page_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); set_size_request(width, -1); home_page_box.set_size_request(width, -1); - + pack_start(switcher, true, true, 0); - + show_home_page(); - - draw.connect(on_draw); + + draw.connect(on_draw); } - + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { bool is_light_theme = ((Widgets.ConfigWindow) get_toplevel()).is_light_theme(); - + Gtk.Allocation rect; widget.get_allocation(out rect); - + try { background_color = Utils.hex_to_rgba(parent_window.config.config_file.get_string("theme", "background")); } catch (Error e) { @@ -92,18 +92,18 @@ } cr.set_source_rgba(background_color.red, background_color.green, background_color.blue, 0.8); Draw.draw_rectangle(cr, 1, 0, rect.width - 1, rect.height); - + if (is_light_theme) { Utils.set_context_color(cr, line_light_color); } else { Utils.set_context_color(cr, line_dark_color); } Draw.draw_rectangle(cr, 0, 0, 1, rect.height); - + return false; } - - public void show_home_page(Gtk.Widget? start_widget=null) { + + public void show_home_page(Gtk.Widget? start_widget=null) { scrolledwindow = new ScrolledWindow(null, null); scrolledwindow.get_style_context().add_class("scrolledwindow"); scrolledwindow.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC); @@ -114,7 +114,7 @@ realize.connect((w) => { init_scrollbar(); }); - + var encoding_list = new EncodingList(focus_term.term.get_encoding(), parent_window.config.encoding_names, workspace); encoding_list.margin_top = encoding_list_margin_top; encoding_list.margin_bottom = encoding_list_margin_bottom; @@ -124,33 +124,33 @@ } catch (Error e) { print("EncodingPanel set_encoding error: %s\n", e.message); } - + init_scrollbar(); queue_draw(); }); - + scrolledwindow.add(encoding_list); - + switcher.add_to_left_box(home_page_box); show.connect((w) => { GLib.Timeout.add(100, () => { int widget_x, widget_y; encoding_list.active_encoding_button.translate_coordinates(encoding_list, 0, 0, out widget_x, out widget_y); - + Gtk.Allocation rect; get_allocation(out rect); - + var adjust = scrolledwindow.get_vadjustment(); adjust.set_value(widget_y - (rect.height - Constant.ENCODING_BUTTON_HEIGHT) / 2); - + return false; }); }); - + show_all(); - } + } public void init_scrollbar() { scrolledwindow.get_vscrollbar().get_style_context().remove_class("light_scrollbar"); @@ -163,4 +163,4 @@ } } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/entry_menu.vala deepin-terminal-3.0.7/widget/entry_menu.vala --- deepin-terminal-3.0.3+ds/widget/entry_menu.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/entry_menu.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Utils; @@ -27,7 +27,7 @@ namespace Widgets { public class EntryMenu : Object { public Menu.Menu menu; - + public EntryMenu() { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); } @@ -45,7 +45,7 @@ menu_content.append(new Menu.MenuItem("", "")); } menu_content.append(new Menu.MenuItem("select_all", _("Select all"))); - + menu = new Menu.Menu(x, y, menu_content); menu.click_item.connect((item_id) => { handle_menu_item_click(entry, item_id); @@ -71,17 +71,17 @@ entry.select_region(0, -1); break; } - } - + } + public bool is_selection(Gtk.Entry entry) { int start_pos, end_pos; entry.get_selection_bounds(out start_pos, out end_pos); - + return start_pos != end_pos; } - + public void handle_menu_destroy() { menu = null; } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/entry.vala deepin-terminal-3.0.7/widget/entry.vala --- deepin-terminal-3.0.3+ds/widget/entry.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/entry.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Utils; @@ -27,18 +27,18 @@ namespace Widgets { public class Entry : Gtk.Entry { public Widgets.EntryMenu menu; - + public Entry() { button_press_event.connect((w, e) => { if (Utils.is_right_button(e)) { menu = new Widgets.EntryMenu(); menu.create_entry_menu(this, (int) e.x_root, (int) e.y_root); - + return true; } - + return false; }); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/file_button.vala deepin-terminal-3.0.7/widget/file_button.vala --- deepin-terminal-3.0.3+ds/widget/file_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/file_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -31,40 +31,40 @@ public ImageButton file_add_button; public Widgets.Entry entry; public int height = 26; - + public FileButton() { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); - + visible_window = false; - + set_size_request(-1, height); - + box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); - + entry = new Widgets.Entry(); entry.margin_top = 1; entry.margin_bottom = 1; - + file_add_button = new ImageButton("file_add"); - + button_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); box.pack_start(entry, true, true, 0); box.pack_start(button_box, false, false, 0); - + entry.get_style_context().add_class("file_add_entry"); button_box.pack_start(file_add_button, false, false, 0); - + file_add_button.clicked.connect((w, e) => { select_private_key_file(); }); add(box); } - + public void select_private_key_file() { Gtk.FileChooserAction action = Gtk.FileChooserAction.OPEN; - var chooser = new Gtk.FileChooserDialog(_("Select the private key file"), + var chooser = new Gtk.FileChooserDialog(_("Select the private key file"), get_toplevel() as Gtk.Window, action); chooser.add_button(_("Cancel"), Gtk.ResponseType.CANCEL); chooser.set_select_multiple(true); @@ -73,8 +73,8 @@ if (chooser.run () == Gtk.ResponseType.ACCEPT) { entry.set_text(chooser.get_file().get_path()); } - + chooser.destroy(); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/highlight_frame.vala deepin-terminal-3.0.7/widget/highlight_frame.vala --- deepin-terminal-3.0.3+ds/widget/highlight_frame.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/highlight_frame.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,34 +19,34 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; namespace Widgets { - public class HighlightFrame : Gtk.EventBox { + public class HighlightFrame : Gtk.EventBox { public Gdk.RGBA foreground_color = Gdk.RGBA(); - - public HighlightFrame() { + + public HighlightFrame() { draw.connect(on_draw); - } - - private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { + } + + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { Gtk.Allocation rect; widget.get_allocation(out rect); - try { - Widgets.ConfigWindow parent_window = (Widgets.ConfigWindow) this.get_toplevel(); - foreground_color = Utils.hex_to_rgba(parent_window.config.config_file.get_string("theme", "foreground")); - } catch (GLib.KeyFileError e) { + try { + Widgets.ConfigWindow parent_window = (Widgets.ConfigWindow) this.get_toplevel(); + foreground_color = Utils.hex_to_rgba(parent_window.config.config_file.get_string("theme", "foreground")); + } catch (GLib.KeyFileError e) { print("HighlightFrame: %s\n", e.message); - } - + } + cr.set_source_rgba(foreground_color.red, foreground_color.green, foreground_color.blue, 0.4); - Draw.draw_rectangle(cr, rect.x, rect.y, rect.width, rect.height, false); - - return true; - } - } -} \ No newline at end of file + Draw.draw_rectangle(cr, rect.x, rect.y, rect.width, rect.height, false); + + return true; + } + } +} diff -Nru deepin-terminal-3.0.3+ds/widget/image_button.vala deepin-terminal-3.0.7/widget/image_button.vala --- deepin-terminal-3.0.3+ds/widget/image_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/image_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Cairo; using Draw; @@ -28,7 +28,7 @@ namespace Widgets { public class ImageButton : Widgets.ClickEventBox { - public bool is_hover = false; + public bool is_hover = false; public Cairo.ImageSurface hover_dark_surface; public Cairo.ImageSurface hover_light_surface; public Cairo.ImageSurface normal_dark_surface; @@ -41,10 +41,10 @@ public bool is_theme_button; public int button_text_size = 14; public string? button_text; - + public ImageButton(string image_path, bool theme_button=false, string? text=null, int text_size=12) { is_theme_button = theme_button; - + if (is_theme_button) { normal_dark_surface = Utils.create_image_surface(image_path + "_dark_normal.svg"); hover_dark_surface = Utils.create_image_surface(image_path + "_dark_hover.svg"); @@ -58,45 +58,45 @@ hover_dark_surface = Utils.create_image_surface(image_path + "_hover.svg"); press_dark_surface = Utils.create_image_surface(image_path + "_press.svg"); } - + button_text = text; button_text_size = text_size; - + if (button_text != null) { text_normal_color = Utils.hex_to_rgba("#0699FF"); text_hover_color = Utils.hex_to_rgba("#FFFFFF"); text_press_color = Utils.hex_to_rgba("#FFFFFF"); } - - set_size_request(this.normal_dark_surface.get_width() / get_scale_factor(), - this.normal_dark_surface.get_height() / get_scale_factor()); - + + set_size_request(this.normal_dark_surface.get_width() / get_scale_factor(), + this.normal_dark_surface.get_height() / get_scale_factor()); + draw.connect(on_draw); - enter_notify_event.connect((w, e) => { + enter_notify_event.connect((w, e) => { is_hover = true; - queue_draw(); - - return false; - }); - leave_notify_event.connect((w, e) => { - is_hover = false; - queue_draw(); - - return false; - }); - button_press_event.connect((w, e) => { - queue_draw(); - - return false; - }); - button_release_event.connect((w, e) => { + queue_draw(); + + return false; + }); + leave_notify_event.connect((w, e) => { is_hover = false; queue_draw(); - - return false; - }); + + return false; + }); + button_press_event.connect((w, e) => { + queue_draw(); + + return false; + }); + button_release_event.connect((w, e) => { + is_hover = false; + queue_draw(); + + return false; + }); } - + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { bool is_light_theme = false; var top_level = get_toplevel(); @@ -105,17 +105,17 @@ } else { is_light_theme = ((Widgets.ConfigWindow) get_toplevel()).is_light_theme(); } - - var ratio = get_scale_factor(); - - if (is_hover) { + + var ratio = get_scale_factor(); + + if (is_hover) { if (is_press) { if (is_theme_button && is_light_theme) { Draw.draw_surface(cr, press_light_surface); } else { Draw.draw_surface(cr, press_dark_surface); } - + if (button_text != null) { Utils.set_context_color(cr, text_press_color); Draw.draw_text(cr, button_text, 0, 0, normal_dark_surface.get_width() / ratio, normal_dark_surface.get_height() / ratio, button_text_size, Pango.Alignment.CENTER); @@ -126,7 +126,7 @@ } else { Draw.draw_surface(cr, hover_dark_surface); } - + if (button_text != null) { Utils.set_context_color(cr, text_hover_color); Draw.draw_text(cr, button_text, 0, 0, normal_dark_surface.get_width() / ratio, normal_dark_surface.get_height() / ratio, button_text_size, Pango.Alignment.CENTER); @@ -138,14 +138,14 @@ } else { Draw.draw_surface(cr, normal_dark_surface); } - + if (button_text != null) { Utils.set_context_color(cr, text_normal_color); Draw.draw_text(cr, button_text, 0, 0, normal_dark_surface.get_width() / ratio, normal_dark_surface.get_height() / ratio, button_text_size, Pango.Alignment.CENTER); } } - + return true; } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/link_button.vala deepin-terminal-3.0.7/widget/link_button.vala --- deepin-terminal-3.0.3+ds/widget/link_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/link_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; @@ -28,14 +28,14 @@ public string link_css; public string link_name; public string link_uri; - + public LinkButton(string link_name, string link_uri, string link_css) { add_events(Gdk.EventMask.BUTTON_PRESS_MASK - | Gdk.EventMask.BUTTON_RELEASE_MASK - | Gdk.EventMask.POINTER_MOTION_MASK - | Gdk.EventMask.LEAVE_NOTIFY_MASK); + | Gdk.EventMask.BUTTON_RELEASE_MASK + | Gdk.EventMask.POINTER_MOTION_MASK + | Gdk.EventMask.LEAVE_NOTIFY_MASK); visible_window = false; - + var link_label = new Gtk.Label(null); link_label.set_text(link_name); link_label.get_style_context().add_class(link_css); @@ -43,12 +43,12 @@ enter_notify_event.connect((w, e) => { var display = Gdk.Display.get_default(); get_window().set_cursor(new Gdk.Cursor.for_display(display, Gdk.CursorType.HAND1)); - + return false; }); leave_notify_event.connect((w, e) => { get_window().set_cursor(null); - + return false; }); clicked.connect((w, e) => { @@ -58,7 +58,7 @@ } catch (GLib.Error e) { print("LinkButton: %s\n", e.message); } - }); + }); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/panel_button.vala deepin-terminal-3.0.7/widget/panel_button.vala --- deepin-terminal-3.0.3+ds/widget/panel_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/panel_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,14 +19,14 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; namespace Widgets { public class PanelButton : Widgets.ClickEventBox { - public bool is_hover = false; + public bool is_hover = false; public Cairo.ImageSurface button_dark_surface; public Cairo.ImageSurface button_edit_hover_dark_surface; public Cairo.ImageSurface button_edit_hover_light_surface; @@ -62,29 +62,29 @@ public string button_content; public string button_name; public string? button_display_name; - + public signal void click_button(); public signal void click_edit_button(); - + public PanelButton(string name, string content, string? display_name, string edit_button_name) { this.add_events(Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK | Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.LEAVE_NOTIFY_MASK); - + button_name = name; button_content = content; button_display_name = display_name; - - button_dark_surface = Utils.create_image_surface("%s_dark.svg".printf(edit_button_name)); - button_light_surface = Utils.create_image_surface("%s_light.svg".printf(edit_button_name)); - button_edit_normal_dark_surface = Utils.create_image_surface("button_edit_dark_normal.svg"); - button_edit_hover_dark_surface = Utils.create_image_surface("button_edit_dark_hover.svg"); - button_edit_press_dark_surface = Utils.create_image_surface("button_edit_dark_press.svg"); - button_edit_normal_light_surface = Utils.create_image_surface("button_edit_light_normal.svg"); - button_edit_hover_light_surface = Utils.create_image_surface("button_edit_light_hover.svg"); - button_edit_press_light_surface = Utils.create_image_surface("button_edit_light_press.svg"); - + + button_dark_surface = Utils.create_image_surface("%s_dark.svg".printf(edit_button_name)); + button_light_surface = Utils.create_image_surface("%s_light.svg".printf(edit_button_name)); + button_edit_normal_dark_surface = Utils.create_image_surface("button_edit_dark_normal.svg"); + button_edit_hover_dark_surface = Utils.create_image_surface("button_edit_dark_hover.svg"); + button_edit_press_dark_surface = Utils.create_image_surface("button_edit_dark_press.svg"); + button_edit_normal_light_surface = Utils.create_image_surface("button_edit_light_normal.svg"); + button_edit_hover_light_surface = Utils.create_image_surface("button_edit_light_hover.svg"); + button_edit_press_light_surface = Utils.create_image_surface("button_edit_light_press.svg"); + button_name_dark_color = Utils.hex_to_rgba("#FFFFFF"); button_content_dark_color = Utils.hex_to_rgba("#FFFFFF", 0.5); press_dark_color = Utils.hex_to_rgba("#FFFFFF", 0.1); @@ -95,35 +95,35 @@ hover_light_color = Utils.hex_to_rgba("#000000", 0.1); line_dark_color = Utils.hex_to_rgba("#ffffff", 0.05); line_light_color = Utils.hex_to_rgba("#000000", 0.05); - + set_size_request(width, height); - + edit_button_y = (height - button_edit_press_dark_surface.get_height()) / 2; - + draw.connect(on_draw); - enter_notify_event.connect((w, e) => { - is_hover = true; - queue_draw(); - - return false; - }); - leave_notify_event.connect((w, e) => { - is_hover = false; - queue_draw(); - - return false; - }); - button_press_event.connect((w, e) => { - queue_draw(); - - return false; - }); - button_release_event.connect((w, e) => { + enter_notify_event.connect((w, e) => { + is_hover = true; + queue_draw(); + + return false; + }); + leave_notify_event.connect((w, e) => { + is_hover = false; + queue_draw(); + + return false; + }); + button_press_event.connect((w, e) => { + queue_draw(); + + return false; + }); + button_release_event.connect((w, e) => { is_hover = false; - queue_draw(); - - return false; - }); + queue_draw(); + + return false; + }); clicked.connect((w, e) => { if (e.x > edit_button_x && e.x < edit_button_x + button_edit_normal_dark_surface.get_width() && e.y > edit_button_y && e.y < height - button_edit_normal_dark_surface.get_height()) { @@ -143,23 +143,23 @@ } else { is_at_edit_button_area = false; } - queue_draw(); - + queue_draw(); + return false; }); } - + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { - + bool is_light_theme = ((Widgets.ConfigWindow) get_toplevel()).is_light_theme(); - + if (is_light_theme) { Draw.draw_surface(cr, button_light_surface, image_x, 0, 0, height); } else { Draw.draw_surface(cr, button_dark_surface, image_x, 0, 0, height); } - - + + if (is_hover) { if (is_at_edit_button_area) { if (is_press) { @@ -181,10 +181,10 @@ } else { Draw.draw_surface(cr, button_edit_normal_dark_surface, edit_button_x, 0, 0, height); } - + } } - + if (is_light_theme) { Utils.set_context_color(cr, button_name_light_color); } else { @@ -202,7 +202,7 @@ } else { Draw.draw_text(cr, button_content, text_x, button_content_y, text_width, height, button_content_size, Pango.Alignment.LEFT, "top"); } - + if (display_bottom_line) { if (is_light_theme) { Utils.set_context_color(cr, line_light_color); @@ -211,7 +211,7 @@ } Draw.draw_rectangle(cr, 8, height - 1, width - 16, 1); } - + if (is_press) { if (is_light_theme) { Utils.set_context_color(cr, press_light_color); @@ -227,8 +227,8 @@ } Draw.draw_rectangle(cr, 0, 0, width, height); } - + return true; } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/password_button.vala deepin-terminal-3.0.7/widget/password_button.vala --- deepin-terminal-3.0.3+ds/widget/password_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/password_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -32,30 +32,30 @@ public ImageButton show_password_button; public Widgets.Entry entry; public int height = 26; - + public PasswordButton() { visible_window = false; - + set_size_request(-1, height); - + box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); - + entry = new Widgets.Entry(); entry.margin_top = 1; entry.margin_bottom = 1; entry.set_invisible_char('●'); entry.set_input_purpose(Gtk.InputPurpose.PASSWORD); - + show_password_button = new ImageButton("password_show"); hide_password_button = new ImageButton("password_hide"); - + button_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); box.pack_start(entry, true, true, 0); box.pack_start(button_box, false, false, 0); - + init(); - + show_password_button.clicked.connect((w, e) => { show_password(); }); @@ -63,7 +63,7 @@ hide_password_button.clicked.connect((w, e) => { hide_password(); }); - + entry.get_buffer().deleted_text.connect((buffer, p, nc) => { string entry_text = entry.get_text().strip(); if (entry_text == "") { @@ -79,7 +79,7 @@ } } }); - + entry.get_buffer().inserted_text.connect((buffer, p, c, nc) => { string entry_text = entry.get_text().strip(); if (entry_text == "") { @@ -95,42 +95,42 @@ } } }); - - + + add(box); } - + public void init() { Utils.remove_all_children(button_box); - + entry.get_style_context().remove_class("password_invisible_entry"); entry.get_style_context().add_class("password_visible_entry"); entry.set_visibility(false); button_box.pack_start(show_password_button, false, false, 0); - + show_all(); } - + public void show_password() { Utils.remove_all_children(button_box); - + entry.get_style_context().remove_class("password_invisible_entry"); entry.get_style_context().add_class("password_visible_entry"); entry.set_visibility(true); button_box.pack_start(hide_password_button, false, false, 0); - + show_all(); } - + public void hide_password() { Utils.remove_all_children(button_box); - + entry.get_style_context().remove_class("password_visible_entry"); entry.get_style_context().add_class("password_invisible_entry"); entry.set_visibility(false); button_box.pack_start(show_password_button, false, false, 0); - + show_all(); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/preference_slidebar.vala deepin-terminal-3.0.7/widget/preference_slidebar.vala --- deepin-terminal-3.0.3+ds/widget/preference_slidebar.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/preference_slidebar.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -37,63 +37,63 @@ public PreferenceSlideItem theme_segment; public PreferenceSlideItem window_segment; public PreferenceSlideItem workspace_key_segment; - public int height = 30; + public int height = 30; public int segment_spacing = 20; public int width = Constant.PREFERENCE_SLIDEBAR_WIDTH; - - public signal void click_item(string name); - + + public signal void click_item(string name); + public PreferenceSlidebar() { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); - - set_size_request(width, -1); - + + set_size_request(width, -1); + var spacing_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); spacing_box.set_size_request(-1, Constant.TITLEBAR_HEIGHT); this.attach(spacing_box, 0, 0, width, height); - + basic_segment = new PreferenceSlideItem(this, _("Basic"), "basic", true); - this.attach_next_to(basic_segment, spacing_box, Gtk.PositionType.BOTTOM, width, height); - + this.attach_next_to(basic_segment, spacing_box, Gtk.PositionType.BOTTOM, width, height); + theme_segment = new PreferenceSlideItem(this, _("Interface"), "theme", false); - this.attach_next_to(theme_segment, basic_segment, Gtk.PositionType.BOTTOM, width, height); - + this.attach_next_to(theme_segment, basic_segment, Gtk.PositionType.BOTTOM, width, height); + var theme_spacing_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); theme_spacing_box.set_size_request(-1, segment_spacing); this.attach_next_to(theme_spacing_box, theme_segment, Gtk.PositionType.BOTTOM, width, height); - + hotkey_segment = new PreferenceSlideItem(this, _("Shortcuts"), "hotkey", true); - this.attach_next_to(hotkey_segment, theme_spacing_box, Gtk.PositionType.BOTTOM, width, height); + this.attach_next_to(hotkey_segment, theme_spacing_box, Gtk.PositionType.BOTTOM, width, height); terminal_key_segment = new PreferenceSlideItem(this, _("Terminal"), "terminal_key", false); - this.attach_next_to(terminal_key_segment, hotkey_segment, Gtk.PositionType.BOTTOM, width, height); - + this.attach_next_to(terminal_key_segment, hotkey_segment, Gtk.PositionType.BOTTOM, width, height); + workspace_key_segment = new PreferenceSlideItem(this, _("Workspace"), "workspace_key", false); - this.attach_next_to(workspace_key_segment, terminal_key_segment, Gtk.PositionType.BOTTOM, width, height); - + this.attach_next_to(workspace_key_segment, terminal_key_segment, Gtk.PositionType.BOTTOM, width, height); + advanced_key_segment = new PreferenceSlideItem(this, _("Advanced"), "advanced_key", false); - this.attach_next_to(advanced_key_segment, workspace_key_segment, Gtk.PositionType.BOTTOM, width, height); + this.attach_next_to(advanced_key_segment, workspace_key_segment, Gtk.PositionType.BOTTOM, width, height); var advanced_key_spacing_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); advanced_key_spacing_box.set_size_request(-1, segment_spacing); this.attach_next_to(advanced_key_spacing_box, advanced_key_segment, Gtk.PositionType.BOTTOM, width, height); - + advanced_segment = new PreferenceSlideItem(this, _("Advanced"), "advanced", true); - this.attach_next_to(advanced_segment, advanced_key_spacing_box, Gtk.PositionType.BOTTOM, width, height); - + this.attach_next_to(advanced_segment, advanced_key_spacing_box, Gtk.PositionType.BOTTOM, width, height); + cursor_segment = new PreferenceSlideItem(this, _("Cursor"), "cursor", false); - this.attach_next_to(cursor_segment, advanced_segment, Gtk.PositionType.BOTTOM, width, height); + this.attach_next_to(cursor_segment, advanced_segment, Gtk.PositionType.BOTTOM, width, height); scroll_segment = new PreferenceSlideItem(this, _("Scroll"), "scroll", false); - this.attach_next_to(scroll_segment, cursor_segment, Gtk.PositionType.BOTTOM, width, height); + this.attach_next_to(scroll_segment, cursor_segment, Gtk.PositionType.BOTTOM, width, height); window_segment = new PreferenceSlideItem(this, _("Window"), "window", false); - this.attach_next_to(window_segment, scroll_segment, Gtk.PositionType.BOTTOM, width, height); - + this.attach_next_to(window_segment, scroll_segment, Gtk.PositionType.BOTTOM, width, height); + var window_spacing_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); window_spacing_box.set_size_request(-1, segment_spacing); this.attach_next_to(window_spacing_box, window_segment, Gtk.PositionType.BOTTOM, width, height); - + add_focus_handler(basic_segment); add_focus_handler(theme_segment); add_focus_handler(hotkey_segment); @@ -105,38 +105,38 @@ add_focus_handler(scroll_segment); add_focus_handler(window_segment); focus_item(basic_segment); - + draw.connect(on_draw); - + show_all(); } - + public void focus_item(PreferenceSlideItem item) { if (focus_segment_item != null) { focus_segment_item.is_selected = false; focus_segment_item.queue_draw(); } - + focus_segment_item = item; focus_segment_item.is_selected = true; queue_draw(); } - + public void add_focus_handler(PreferenceSlideItem item) { item.button_press_event.connect((w, e) => { focus_item(item); - + return false; }); } - + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { Gtk.Allocation alloc; this.get_allocation(out alloc); - + cr.set_source_rgba(0, 0, 0, 0.1); Draw.draw_rectangle(cr, alloc.width - 1, 0, 1, alloc.height); - + return false; } } @@ -145,64 +145,64 @@ public string item_name; public bool item_active; public bool is_first_segment; - + public int first_segment_margin = 30; public int second_segment_margin = 40; - + public int first_segment_size = 12; public int second_segment_size = 10; - + public Gdk.RGBA first_segment_text_color; public Gdk.RGBA second_segment_text_color; public Gdk.RGBA highlight_text_color; - + public bool is_selected = false; - + public int width = Constant.PREFERENCE_SLIDEBAR_WIDTH; public int height = 30; - + public PreferenceSlideItem(PreferenceSlidebar bar, string display_name, string name, bool is_first) { - set_visible_window(false); - + set_visible_window(false); + item_name = display_name; is_first_segment = is_first; - + first_segment_text_color = Utils.hex_to_rgba("#00162C"); second_segment_text_color = Utils.hex_to_rgba("#303030"); highlight_text_color = Utils.hex_to_rgba("#2ca7f8"); - + set_size_request(width, height); - - button_press_event.connect((w, e) => { - bar.click_item(name); - - return false; - }); - + + button_press_event.connect((w, e) => { + bar.click_item(name); + + return false; + }); + draw.connect(on_draw); } - + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { Gtk.Allocation rect; widget.get_allocation(out rect); - + cr.set_source_rgba(1, 1, 1, 1); Draw.draw_rectangle(cr, 0, 0, rect.width - 1, rect.height, true); - + if (is_selected) { cr.set_source_rgba(43 / 255.0, 167 / 255.0, 248 / 255.0, 0.20); Draw.draw_rectangle(cr, 0, 0, rect.width, rect.height, true); - + cr.set_source_rgba(43 / 255.0, 167 / 255.0, 248 / 255.0, 0.10); Draw.draw_rectangle(cr, 0, 0, rect.width, 1, true); cr.set_source_rgba(43 / 255.0, 167 / 255.0, 248 / 255.0, 0.10); Draw.draw_rectangle(cr, 0, rect.height - 1, rect.width, 1, true); - + cr.set_source_rgba(43 / 255.0, 167 / 255.0, 248 / 255.0, 1); Draw.draw_rectangle(cr, rect.width - 3, 0, 3, rect.height, true); } - + if (is_first_segment) { if (is_selected) { Utils.set_context_color(cr, highlight_text_color); @@ -218,8 +218,8 @@ } Draw.draw_text(cr, item_name, second_segment_margin, 0, rect.width - second_segment_margin, rect.height, second_segment_size); } - + return true; } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/preference.vala deepin-terminal-3.0.7/widget/preference.vala --- deepin-terminal-3.0.3+ds/widget/preference.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/preference.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Animation; using Gee; @@ -28,84 +28,84 @@ namespace Widgets { public class Preference : Widgets.Dialog { - public ArrayList font_names; - public ArrayList window_state_list; - public ArrayList window_state_name_list; - public Widgets.DropdownTextButton font_combox; - public Widgets.DropdownTextButton window_combox; - public Gtk.Label close_other_windows_key_label; - public Gtk.Label close_window_key_label; - public Gtk.Label close_workspace_key_label; - public Gtk.Label copy_key_label; - public Gtk.Label cursor_style_label; - public Gtk.Label display_hotkey_terminal_key_label; - public Gtk.Label font_label; - public Gtk.Label fullscreen_key_label; - public Gtk.Label jump_to_next_command_key_label; - public Gtk.Label jump_to_previous_command_key_label; - public Gtk.Label new_workspace_key_label; - public Gtk.Label next_workspace_key_label; - public Gtk.Label opacity_label; - public Gtk.Label open_key_label; - public Gtk.Label paste_key_label; - public Gtk.Label previous_workspace_key_label; - public Gtk.Label rename_title_key_label; - public Gtk.Label search_key_label; - public Gtk.Label select_all_key_label; - public Gtk.Label select_down_window_key_label; - public Gtk.Label select_left_window_key_label; - public Gtk.Label select_right_window_key_label; - public Gtk.Label select_up_window_key_label; - public Gtk.Label show_command_key_label; - public Gtk.Label show_remote_manage_key_label; - public Gtk.Label split_horizontally_key_label; - public Gtk.Label split_vertically_key_label; - public Gtk.Label theme_label; - public Gtk.Label window_label; - public Gtk.Label blur_background_label; - public Gtk.Label zoom_in_key_label; - public Gtk.Label zoom_out_key_label; - public Gtk.Label zoom_reset_key_label; - public ScrolledWindow scrolledwindow; - public ShortcutEntry close_other_windows_key_entry; - public ShortcutEntry close_window_key_entry; - public ShortcutEntry close_workspace_key_entry; - public ShortcutEntry copy_key_entry; - public ShortcutEntry display_hotkey_terminal_key_entry; - public ShortcutEntry fullscreen_key_entry; - public ShortcutEntry jump_to_next_command_key_entry; - public ShortcutEntry jump_to_previous_command_key_entry; - public ShortcutEntry new_workspace_key_entry; - public ShortcutEntry next_workspace_key_entry; - public ShortcutEntry open_key_entry; - public ShortcutEntry paste_key_entry; - public ShortcutEntry previous_workspace_key_entry; - public ShortcutEntry rename_title_key_entry; - public ShortcutEntry search_key_entry; - public ShortcutEntry select_all_key_entry; - public ShortcutEntry select_down_window_key_entry; - public ShortcutEntry select_left_window_key_entry; - public ShortcutEntry select_right_window_key_entry; - public ShortcutEntry select_up_window_key_entry; - public ShortcutEntry show_command_key_entry; - public ShortcutEntry show_remote_manage_key_entry; - public ShortcutEntry split_horizontally_key_entry; - public ShortcutEntry split_vertically_key_entry; - public ShortcutEntry zoom_in_key_entry; - public ShortcutEntry zoom_out_key_entry; - public ShortcutEntry zoom_reset_key_entry; - public Widgets.CheckButton cursor_auto_hide_checkbutton; - public Widgets.CheckButton cursor_blink_checkbutton; - public Widgets.CheckButton hide_quakewindow_after_lost_focus_checkbutton; - public Widgets.CheckButton scroll_on_key_checkbutton; - public Widgets.CheckButton scroll_on_out_checkbutton; - public Widgets.CheckButton blur_background_checkbutton; - public Widgets.ConfigWindow parent_window; - public Widgets.CursorToggleButton cursor_style_button; - public Widgets.ProgressBar opacity_progressbar; - public Widgets.SpinButton font_size_spinbutton; - public double timer_end_value; - public double timer_start_value; + public ArrayList font_names; + public ArrayList window_state_list; + public ArrayList window_state_name_list; + public Widgets.DropdownTextButton font_combox; + public Widgets.DropdownTextButton window_combox; + public Gtk.Label close_other_windows_key_label; + public Gtk.Label close_window_key_label; + public Gtk.Label close_workspace_key_label; + public Gtk.Label copy_key_label; + public Gtk.Label cursor_style_label; + public Gtk.Label display_hotkey_terminal_key_label; + public Gtk.Label font_label; + public Gtk.Label fullscreen_key_label; + public Gtk.Label jump_to_next_command_key_label; + public Gtk.Label jump_to_previous_command_key_label; + public Gtk.Label new_workspace_key_label; + public Gtk.Label next_workspace_key_label; + public Gtk.Label opacity_label; + public Gtk.Label open_key_label; + public Gtk.Label paste_key_label; + public Gtk.Label previous_workspace_key_label; + public Gtk.Label rename_title_key_label; + public Gtk.Label search_key_label; + public Gtk.Label select_all_key_label; + public Gtk.Label select_down_window_key_label; + public Gtk.Label select_left_window_key_label; + public Gtk.Label select_right_window_key_label; + public Gtk.Label select_up_window_key_label; + public Gtk.Label show_command_key_label; + public Gtk.Label show_remote_manage_key_label; + public Gtk.Label split_horizontally_key_label; + public Gtk.Label split_vertically_key_label; + public Gtk.Label theme_label; + public Gtk.Label window_label; + public Gtk.Label blur_background_label; + public Gtk.Label zoom_in_key_label; + public Gtk.Label zoom_out_key_label; + public Gtk.Label zoom_reset_key_label; + public ScrolledWindow scrolledwindow; + public ShortcutEntry close_other_windows_key_entry; + public ShortcutEntry close_window_key_entry; + public ShortcutEntry close_workspace_key_entry; + public ShortcutEntry copy_key_entry; + public ShortcutEntry display_hotkey_terminal_key_entry; + public ShortcutEntry fullscreen_key_entry; + public ShortcutEntry jump_to_next_command_key_entry; + public ShortcutEntry jump_to_previous_command_key_entry; + public ShortcutEntry new_workspace_key_entry; + public ShortcutEntry next_workspace_key_entry; + public ShortcutEntry open_key_entry; + public ShortcutEntry paste_key_entry; + public ShortcutEntry previous_workspace_key_entry; + public ShortcutEntry rename_title_key_entry; + public ShortcutEntry search_key_entry; + public ShortcutEntry select_all_key_entry; + public ShortcutEntry select_down_window_key_entry; + public ShortcutEntry select_left_window_key_entry; + public ShortcutEntry select_right_window_key_entry; + public ShortcutEntry select_up_window_key_entry; + public ShortcutEntry show_command_key_entry; + public ShortcutEntry show_remote_manage_key_entry; + public ShortcutEntry split_horizontally_key_entry; + public ShortcutEntry split_vertically_key_entry; + public ShortcutEntry zoom_in_key_entry; + public ShortcutEntry zoom_out_key_entry; + public ShortcutEntry zoom_reset_key_entry; + public Widgets.CheckButton cursor_auto_hide_checkbutton; + public Widgets.CheckButton cursor_blink_checkbutton; + public Widgets.CheckButton hide_quakewindow_after_lost_focus_checkbutton; + public Widgets.CheckButton scroll_on_key_checkbutton; + public Widgets.CheckButton scroll_on_out_checkbutton; + public Widgets.CheckButton blur_background_checkbutton; + public Widgets.ConfigWindow parent_window; + public Widgets.CursorToggleButton cursor_style_button; + public Widgets.ProgressBar opacity_progressbar; + public Widgets.SpinButton font_size_spinbutton; + public double timer_end_value; + public double timer_start_value; public AnimateTimer timer; public Gtk.Box content_box; public Gtk.Widget? focus_widget; @@ -129,193 +129,193 @@ public Preference(Widgets.ConfigWindow window, Gtk.Widget? widget) { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); - + set_init_size(740, 670); - - theme_label = create_label(); + + theme_label = create_label(); opacity_label = create_label(_("Opacity:")); opacity_progressbar = new Widgets.ProgressBar(opacity); - font_label = create_label(); - font_combox = create_combox_text(); - window_label = create_label(); - window_combox = create_combox_text(); - blur_background_label = create_label(); - - copy_key_label = create_label(); - copy_key_entry = new ShortcutEntry(); - paste_key_label = create_label(); - paste_key_entry = new ShortcutEntry(); - open_key_label = create_label(); - open_key_entry = new ShortcutEntry(); - search_key_label = create_label(); - search_key_entry = new ShortcutEntry(); - zoom_in_key_label = create_label(); - zoom_in_key_entry = new ShortcutEntry(); - zoom_out_key_label = create_label(); - zoom_out_key_entry = new ShortcutEntry(); - zoom_reset_key_label = create_label(); - zoom_reset_key_entry = new ShortcutEntry(); - jump_to_next_command_key_label = create_label(); - jump_to_next_command_key_entry = new ShortcutEntry(); - jump_to_previous_command_key_label = create_label(); - jump_to_previous_command_key_entry = new ShortcutEntry(); - select_all_key_label = create_label(); - select_all_key_entry = new ShortcutEntry(); - new_workspace_key_label = create_label(); - new_workspace_key_entry = new ShortcutEntry(); - close_workspace_key_label = create_label(); - close_workspace_key_entry = new ShortcutEntry(); - previous_workspace_key_label = create_label(); - previous_workspace_key_entry = new ShortcutEntry(); - next_workspace_key_label = create_label(); - next_workspace_key_entry = new ShortcutEntry(); - split_vertically_key_label = create_label(); - split_vertically_key_entry = new ShortcutEntry(); - split_horizontally_key_label = create_label(); - split_horizontally_key_entry = new ShortcutEntry(); - select_up_window_key_label = create_label(); - select_up_window_key_entry = new ShortcutEntry(); - select_down_window_key_label = create_label(); - select_down_window_key_entry = new ShortcutEntry(); - select_left_window_key_label = create_label(); - select_left_window_key_entry = new ShortcutEntry(); - select_right_window_key_label = create_label(); - select_right_window_key_entry = new ShortcutEntry(); - close_window_key_label = create_label(); - close_window_key_entry = new ShortcutEntry(); - close_other_windows_key_label = create_label(); - close_other_windows_key_entry = new ShortcutEntry(); - fullscreen_key_label = create_label(); - fullscreen_key_entry = new ShortcutEntry(); - rename_title_key_label = create_label(); - rename_title_key_entry = new ShortcutEntry(); - display_hotkey_terminal_key_label = create_label(); - display_hotkey_terminal_key_entry = new ShortcutEntry(); - show_command_key_label = create_label(); - show_remote_manage_key_label = create_label(); - show_command_key_entry = new ShortcutEntry(); - show_remote_manage_key_entry = new ShortcutEntry(); - + font_label = create_label(); + font_combox = create_combox_text(); + window_label = create_label(); + window_combox = create_combox_text(); + blur_background_label = create_label(); + + copy_key_label = create_label(); + copy_key_entry = new ShortcutEntry(); + paste_key_label = create_label(); + paste_key_entry = new ShortcutEntry(); + open_key_label = create_label(); + open_key_entry = new ShortcutEntry(); + search_key_label = create_label(); + search_key_entry = new ShortcutEntry(); + zoom_in_key_label = create_label(); + zoom_in_key_entry = new ShortcutEntry(); + zoom_out_key_label = create_label(); + zoom_out_key_entry = new ShortcutEntry(); + zoom_reset_key_label = create_label(); + zoom_reset_key_entry = new ShortcutEntry(); + jump_to_next_command_key_label = create_label(); + jump_to_next_command_key_entry = new ShortcutEntry(); + jump_to_previous_command_key_label = create_label(); + jump_to_previous_command_key_entry = new ShortcutEntry(); + select_all_key_label = create_label(); + select_all_key_entry = new ShortcutEntry(); + new_workspace_key_label = create_label(); + new_workspace_key_entry = new ShortcutEntry(); + close_workspace_key_label = create_label(); + close_workspace_key_entry = new ShortcutEntry(); + previous_workspace_key_label = create_label(); + previous_workspace_key_entry = new ShortcutEntry(); + next_workspace_key_label = create_label(); + next_workspace_key_entry = new ShortcutEntry(); + split_vertically_key_label = create_label(); + split_vertically_key_entry = new ShortcutEntry(); + split_horizontally_key_label = create_label(); + split_horizontally_key_entry = new ShortcutEntry(); + select_up_window_key_label = create_label(); + select_up_window_key_entry = new ShortcutEntry(); + select_down_window_key_label = create_label(); + select_down_window_key_entry = new ShortcutEntry(); + select_left_window_key_label = create_label(); + select_left_window_key_entry = new ShortcutEntry(); + select_right_window_key_label = create_label(); + select_right_window_key_entry = new ShortcutEntry(); + close_window_key_label = create_label(); + close_window_key_entry = new ShortcutEntry(); + close_other_windows_key_label = create_label(); + close_other_windows_key_entry = new ShortcutEntry(); + fullscreen_key_label = create_label(); + fullscreen_key_entry = new ShortcutEntry(); + rename_title_key_label = create_label(); + rename_title_key_entry = new ShortcutEntry(); + display_hotkey_terminal_key_label = create_label(); + display_hotkey_terminal_key_entry = new ShortcutEntry(); + show_command_key_label = create_label(); + show_remote_manage_key_label = create_label(); + show_command_key_entry = new ShortcutEntry(); + show_remote_manage_key_entry = new ShortcutEntry(); + cursor_style_label = create_label(_("Cursor style:")); - cursor_style_button = new Widgets.CursorToggleButton(); - cursor_blink_checkbutton = new Widgets.CheckButton(); - cursor_auto_hide_checkbutton = new Widgets.CheckButton(); - scroll_on_key_checkbutton = new Widgets.CheckButton(); - scroll_on_out_checkbutton = new Widgets.CheckButton(); - blur_background_checkbutton = new Widgets.CheckButton(); + cursor_style_button = new Widgets.CursorToggleButton(); + cursor_blink_checkbutton = new Widgets.CheckButton(); + cursor_auto_hide_checkbutton = new Widgets.CheckButton(); + scroll_on_key_checkbutton = new Widgets.CheckButton(); + scroll_on_out_checkbutton = new Widgets.CheckButton(); + blur_background_checkbutton = new Widgets.CheckButton(); hide_quakewindow_after_lost_focus_checkbutton = new Widgets.CheckButton(); - - font_size_spinbutton = create_spinbutton(Constant.FONT_MIN_SIZE, Constant.FONT_MAX_SIZE, 1); - + + font_size_spinbutton = create_spinbutton(Constant.FONT_MIN_SIZE, Constant.FONT_MAX_SIZE, 1); + parent_window = window; - + focus_widget = widget; - + var titlebar = new Titlebar(); titlebar.close_button.clicked.connect((b) => { this.destroy(); }); - + var box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); box.pack_start(titlebar, false, false, 0); - + destroy.connect((w) => { if (focus_widget != null) { focus_widget.grab_focus(); } }); - + var preference_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); add_widget(preference_box); - + slidebar = new PreferenceSlidebar(); - preference_box.pack_start(slidebar, false, false, 0); + preference_box.pack_start(slidebar, false, false, 0); preference_box.set_size_request(slidebar_width, -1); - + scrolledwindow = new ScrolledWindow(null, null); scrolledwindow.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC); scrolledwindow.set_shadow_type(Gtk.ShadowType.NONE); scrolledwindow.get_style_context().add_class("scrolledwindow"); scrolledwindow.get_vscrollbar().get_style_context().add_class("light_scrollbar"); box.pack_start(scrolledwindow, true, true, 0); - + preference_box.pack_start(box, true, true, 0); content_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); content_box.margin_end = 20; scrolledwindow.add(content_box); - + var basic_segment = get_first_segment(_("Basic")); content_box.pack_start(basic_segment, false, false, 0); var theme_segment = get_second_segment(_("Interface")); content_box.pack_start(theme_segment, false, false, 0); - + var theme_grid = new Gtk.Grid(); content_box.pack_start(theme_grid, false, false, 0); - + var opacity_grid = new Gtk.Grid(); content_box.pack_start(opacity_grid, false, false, 0); - - double opacity = 0; - try { - opacity = parent_window.config.config_file.get_double("general", "opacity"); - } catch (GLib.KeyFileError e) { - print("Preference get window config: %s\n", e.message); - } - - opacity_progressbar.set_percent(opacity); - opacity_progressbar.update.connect((w, percent) => { + + double opacity = 0; + try { + opacity = parent_window.config.config_file.get_double("general", "opacity"); + } catch (GLib.KeyFileError e) { + print("Preference get window config: %s\n", e.message); + } + + opacity_progressbar.set_percent(opacity); + opacity_progressbar.update.connect((w, percent) => { parent_window.config.load_config(); - parent_window.config.config_file.set_double("general", "opacity", percent); - parent_window.config.save(); - - parent_window.config.update(); - }); - adjust_option_widgets(opacity_label, opacity_progressbar); + parent_window.config.config_file.set_double("general", "opacity", percent); + parent_window.config.save(); + + parent_window.config.update(); + }); + adjust_option_widgets(opacity_label, opacity_progressbar); grid_attach(opacity_grid, opacity_label, 0, 0, preference_name_width, grid_height); grid_attach_next_to(opacity_grid, opacity_progressbar, opacity_label, Gtk.PositionType.RIGHT, preference_widget_width, grid_height); - opacity_label.get_style_context().add_class("preference_title"); - + opacity_label.get_style_context().add_class("preference_title"); + var font_grid = new Gtk.Grid(); content_box.pack_start(font_grid, false, false, 0); - - int num; - string[] mono_or_dot_fonts = (string[]) list_mono_or_dot_fonts(out num); - font_names = new ArrayList(); - for (int i = 0; i < num; i++) { - font_names.add(mono_or_dot_fonts[i]); - } - font_names.sort(); - + + int num; + string[] mono_or_dot_fonts = (string[]) list_mono_or_dot_fonts(out num); + font_names = new ArrayList(); + for (int i = 0; i < num; i++) { + font_names.add(mono_or_dot_fonts[i]); + } + font_names.sort(); + create_combox_row(font_label, font_combox, _("Font:"), font_grid, font_names, "general", "font"); create_follow_spinbutton_row(font_size_spinbutton, _("Font size:"), font_label, font_grid, "general", "font_size"); - - var hotkey_segment = get_first_segment(_("Shortcuts")); + + var hotkey_segment = get_first_segment(_("Shortcuts")); content_box.pack_start(hotkey_segment, false, false, 0); - + var terminal_key_segment = get_second_segment(_("Terminal")); content_box.pack_start(terminal_key_segment, false, false, 0); - + var terminal_key_grid = new Gtk.Grid(); content_box.pack_start(terminal_key_grid, false, false, 0); - + create_key_row(copy_key_label, copy_key_entry, _("Copy:"), terminal_key_grid, "shortcut", "copy"); create_follow_key_row(paste_key_label, paste_key_entry, _("Paste:"), copy_key_label, terminal_key_grid, "shortcut", "paste"); create_follow_key_row(open_key_label, open_key_entry, _("Open:"), paste_key_label, terminal_key_grid, "shortcut", "open"); - create_follow_key_row(search_key_label, search_key_entry, _("Search:"), open_key_label, terminal_key_grid, "shortcut", "search"); + create_follow_key_row(search_key_label, search_key_entry, _("Search:"), open_key_label, terminal_key_grid, "shortcut", "search"); create_follow_key_row(zoom_in_key_label, zoom_in_key_entry, _("Zoom in:"), search_key_label, terminal_key_grid, "shortcut", "zoom_in"); create_follow_key_row(zoom_out_key_label, zoom_out_key_entry, _("Zoom out:"), zoom_in_key_label, terminal_key_grid, "shortcut", "zoom_out"); create_follow_key_row(zoom_reset_key_label, zoom_reset_key_entry, _("Default size:"), zoom_out_key_label, terminal_key_grid, "shortcut", "default_size"); create_follow_key_row(jump_to_next_command_key_label, jump_to_next_command_key_entry, _("Jump to next command:"), zoom_reset_key_label, terminal_key_grid, "shortcut", "jump_to_next_command"); create_follow_key_row(jump_to_previous_command_key_label, jump_to_previous_command_key_entry, _("Jump to previous command:"), jump_to_next_command_key_label, terminal_key_grid, "shortcut", "jump_to_previous_command"); create_follow_key_row(select_all_key_label, select_all_key_entry, _("Select all:"), jump_to_previous_command_key_label, terminal_key_grid, "shortcut", "select_all"); - + var workspace_key_segment = get_second_segment(_("Workspace")); content_box.pack_start(workspace_key_segment, false, false, 0); - + var workspace_key_grid = new Gtk.Grid(); content_box.pack_start(workspace_key_grid, false, false, 0); - + create_key_row(new_workspace_key_label, new_workspace_key_entry, _("New workspace:"), workspace_key_grid, "shortcut", "new_workspace"); create_follow_key_row(close_workspace_key_label, close_workspace_key_entry, _("Close workspace:"), new_workspace_key_label, workspace_key_grid, "shortcut", "close_workspace"); create_follow_key_row(previous_workspace_key_label, previous_workspace_key_entry, _("Previous workspace:"), close_workspace_key_label, workspace_key_grid, "shortcut", "previous_workspace"); @@ -328,64 +328,64 @@ create_follow_key_row(select_right_window_key_label, select_right_window_key_entry, _("Select right window:"), select_left_window_key_label, workspace_key_grid, "shortcut", "select_right_window"); create_follow_key_row(close_window_key_label, close_window_key_entry, _("Close window:"), select_right_window_key_label, workspace_key_grid, "shortcut", "close_window"); create_follow_key_row(close_other_windows_key_label, close_other_windows_key_entry, _("Close other windows:"), close_window_key_label, workspace_key_grid, "shortcut", "close_other_windows"); - + var advanced_key_segment = get_second_segment(_("Advanced")); content_box.pack_start(advanced_key_segment, false, false, 0); - + var advanced_key_grid = new Gtk.Grid(); content_box.pack_start(advanced_key_grid, false, false, 0); - + create_key_row(fullscreen_key_label, fullscreen_key_entry, _("Fullscreen:"), advanced_key_grid, "shortcut", "switch_fullscreen"); create_follow_key_row(rename_title_key_label, rename_title_key_entry, _("Rename title:"), fullscreen_key_label, advanced_key_grid, "shortcut", "rename_title"); create_follow_key_row(display_hotkey_terminal_key_label, display_hotkey_terminal_key_entry, _("Display shortcuts:"), rename_title_key_label, advanced_key_grid, "shortcut", "display_shortcuts"); create_follow_key_row(show_command_key_label, show_command_key_entry, _("Custom commands:"), display_hotkey_terminal_key_label, advanced_key_grid, "shortcut", "custom_commands"); create_follow_key_row(show_remote_manage_key_label, show_remote_manage_key_entry, _("Remote management:"), show_command_key_label, advanced_key_grid, "shortcut", "remote_management"); - + var advanced_segment = get_first_segment(_("Advanced")); content_box.pack_start(advanced_segment, false, false, 0); - + var cursor_segment = get_second_segment(_("Cursor")); content_box.pack_start(cursor_segment, false, false, 0); - + var cursor_grid = new Gtk.Grid(); content_box.pack_start(cursor_grid, false, false, 0); - - - try { - cursor_style_button.set_cursor_state(parent_window.config.config_file.get_string("advanced", "cursor_shape")); - } catch (GLib.KeyFileError e) { - print("Preference set cursor shape: %s\n", e.message); - } - cursor_style_button.change_cursor_state.connect((w, active_state) => { + + + try { + cursor_style_button.set_cursor_state(parent_window.config.config_file.get_string("advanced", "cursor_shape")); + } catch (GLib.KeyFileError e) { + print("Preference set cursor shape: %s\n", e.message); + } + cursor_style_button.change_cursor_state.connect((w, active_state) => { parent_window.config.load_config(); - parent_window.config.config_file.set_string("advanced", "cursor_shape", active_state); - parent_window.config.save(); - - parent_window.config.update(); - }); - adjust_option_widgets(cursor_style_label, cursor_style_button); + parent_window.config.config_file.set_string("advanced", "cursor_shape", active_state); + parent_window.config.save(); + + parent_window.config.update(); + }); + adjust_option_widgets(cursor_style_label, cursor_style_button); grid_attach(cursor_grid, cursor_style_label, 0, 0, preference_name_width, grid_height); grid_attach_next_to(cursor_grid, cursor_style_button, cursor_style_label, Gtk.PositionType.RIGHT, preference_widget_width, grid_height); - cursor_style_label.get_style_context().add_class("preference_title"); - - var cursor_blink_box = create_follow_check_row(cursor_blink_checkbutton, _("Cursor blink"), cursor_style_label, cursor_grid, "advanced", "cursor_blink_mode"); + cursor_style_label.get_style_context().add_class("preference_title"); + + var cursor_blink_box = create_follow_check_row(cursor_blink_checkbutton, _("Cursor blink"), cursor_style_label, cursor_grid, "advanced", "cursor_blink_mode"); create_follow_check_row(cursor_auto_hide_checkbutton, _("Cursor autohide"), cursor_blink_box, cursor_grid, "advanced", "cursor_auto_hide"); - + var scroll_segment = get_second_segment(_("Scroll")); content_box.pack_start(scroll_segment, false, false, 0); - + var scroll_grid = new Gtk.Grid(); content_box.pack_start(scroll_grid, false, false, 0); - + var scroll_on_key_box = create_check_row(scroll_on_key_checkbutton, _("Scroll on keystroke"), scroll_grid, "advanced", "scroll_on_key"); create_follow_check_row(scroll_on_out_checkbutton, _("Scroll on output"), scroll_on_key_box, scroll_grid, "advanced", "scroll_on_output"); - + var window_segment = get_second_segment(_("Window")); content_box.pack_start(window_segment, false, false, 0); - + var window_grid = new Gtk.Grid(); content_box.pack_start(window_grid, false, false, 0); - + window_state_list = new ArrayList(); window_state_list.add("window"); window_state_list.add("maximize"); @@ -395,59 +395,59 @@ window_state_name_list.add(_("Maximize")); window_state_name_list.add(_("Fullscreen")); create_combox_row_with_name(window_label, window_combox, _("Use on starting:"), window_grid, window_state_list, window_state_name_list, "advanced", "use_on_starting"); - - var hide_quakewindow_box = create_follow_check_row(hide_quakewindow_after_lost_focus_checkbutton, - _("Hide quake window after lost focus"), - window_label, - window_grid, - "advanced", - "hide_quakewindow_after_lost_focus"); - + + var hide_quakewindow_box = create_follow_check_row(hide_quakewindow_after_lost_focus_checkbutton, + _("Hide quake window after lost focus"), + window_label, + window_grid, + "advanced", + "hide_quakewindow_after_lost_focus"); + create_follow_check_row(blur_background_checkbutton, - _("Blur background"), - hide_quakewindow_box, - window_grid, - "advanced", - "blur_background"); - - var reset_button = new Widgets.ImageButton("reset_button", false, _("Restore Defaults")); + _("Blur background"), + hide_quakewindow_box, + window_grid, + "advanced", + "blur_background"); + + var reset_button = new Widgets.ImageButton("reset_button", false, _("Restore Defaults")); reset_button.set_halign(Gtk.Align.CENTER); reset_button.margin_top = reset_button_margin; reset_button.margin_bottom = reset_button_margin; - reset_button.clicked.connect((w, e) => { - parent_window.config.init_config(); - parent_window.config.update(); - - init_config(); + reset_button.clicked.connect((w, e) => { + parent_window.config.init_config(); + parent_window.config.update(); + + init_config(); }); content_box.pack_start(reset_button, false, false, 0); - - timer = new AnimateTimer(AnimateTimer.ease_in_out, timer_interval); - timer.animate.connect(on_animate); - slidebar.click_item.connect((w, item) => { - if (item == "basic") { - scroll_to_widget(scrolledwindow, box, basic_segment); - } else if (item == "theme") { - scroll_to_widget(scrolledwindow, box, theme_segment); - } else if (item == "hotkey") { - scroll_to_widget(scrolledwindow, box, hotkey_segment); - } else if (item == "terminal_key") { - scroll_to_widget(scrolledwindow, box, terminal_key_segment); - } else if (item == "workspace_key") { - scroll_to_widget(scrolledwindow, box, workspace_key_segment); - } else if (item == "advanced_key") { - scroll_to_widget(scrolledwindow, box, advanced_key_segment); - } else if (item == "advanced") { - scroll_to_widget(scrolledwindow, box, advanced_segment); - } else if (item == "cursor") { - scroll_to_widget(scrolledwindow, box, cursor_segment); - } else if (item == "scroll") { - scroll_to_widget(scrolledwindow, box, scroll_segment); - } else if (item == "window") { - scroll_to_widget(scrolledwindow, box, window_segment); - } - }); - + + timer = new AnimateTimer(AnimateTimer.ease_in_out, timer_interval); + timer.animate.connect(on_animate); + slidebar.click_item.connect((w, item) => { + if (item == "basic") { + scroll_to_widget(scrolledwindow, box, basic_segment); + } else if (item == "theme") { + scroll_to_widget(scrolledwindow, box, theme_segment); + } else if (item == "hotkey") { + scroll_to_widget(scrolledwindow, box, hotkey_segment); + } else if (item == "terminal_key") { + scroll_to_widget(scrolledwindow, box, terminal_key_segment); + } else if (item == "workspace_key") { + scroll_to_widget(scrolledwindow, box, workspace_key_segment); + } else if (item == "advanced_key") { + scroll_to_widget(scrolledwindow, box, advanced_key_segment); + } else if (item == "advanced") { + scroll_to_widget(scrolledwindow, box, advanced_segment); + } else if (item == "cursor") { + scroll_to_widget(scrolledwindow, box, cursor_segment); + } else if (item == "scroll") { + scroll_to_widget(scrolledwindow, box, scroll_segment); + } else if (item == "window") { + scroll_to_widget(scrolledwindow, box, window_segment); + } + }); + scrolledwindow.get_vadjustment().value_changed.connect((w) => { if (!in_animation) { if (item_in_visible_area(basic_segment)) { @@ -474,108 +474,108 @@ } }); } - - public void init_config() { - try { - opacity_progressbar.set_percent(parent_window.config.config_file.get_double("general", "opacity")); - font_combox.set_active(font_names.index_of(parent_window.config.config_file.get_value("general", "font"))); - window_combox.set_active(window_state_list.index_of(parent_window.config.config_file.get_value("advanced", "use_on_starting"))); - - copy_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "copy")); - paste_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "paste")); - open_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "open")); - search_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "search")); - zoom_in_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "zoom_in")); - zoom_out_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "zoom_out")); - zoom_reset_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "default_size")); - jump_to_next_command_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "jump_to_next_command")); - jump_to_previous_command_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "jump_to_previous_command")); - select_all_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "select_all")); - new_workspace_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "new_workspace")); - close_workspace_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "close_workspace")); - previous_workspace_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "previous_workspace")); - next_workspace_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "next_workspace")); - split_vertically_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "vertical_split")); - split_horizontally_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "horizontal_split")); - select_up_window_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "select_upper_window")); - select_down_window_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "select_lower_window")); - select_left_window_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "select_left_window")); - select_right_window_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "select_right_window")); - close_window_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "close_window")); - close_other_windows_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "close_other_windows")); - fullscreen_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "switch_fullscreen")); - rename_title_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "rename_title")); - display_hotkey_terminal_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "display_shortcuts")); - show_command_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "custom_commands")); - show_remote_manage_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "remote_management")); - - cursor_style_button.set_cursor_state(parent_window.config.config_file.get_string("advanced", "cursor_shape"));; - - cursor_blink_checkbutton.set_active(parent_window.config.config_file.get_boolean("advanced", "cursor_blink_mode")); - cursor_auto_hide_checkbutton.set_active(parent_window.config.config_file.get_boolean("advanced", "cursor_auto_hide")); - scroll_on_key_checkbutton.set_active(parent_window.config.config_file.get_boolean("advanced", "scroll_on_key")); - scroll_on_out_checkbutton.set_active(parent_window.config.config_file.get_boolean("advanced", "scroll_on_output")); - blur_background_checkbutton.set_active(parent_window.config.config_file.get_boolean("advanced", "blur_background")); - hide_quakewindow_after_lost_focus_checkbutton.set_active(parent_window.config.config_file.get_boolean("advanced", "hide_quakewindow_after_lost_focus")); - - font_size_spinbutton.set_value(parent_window.config.config_file.get_integer("general", "font_size")); - } catch (GLib.KeyFileError e) { - print("Preference init_config: %s\n", e.message); - } - - } - + + public void init_config() { + try { + opacity_progressbar.set_percent(parent_window.config.config_file.get_double("general", "opacity")); + font_combox.set_active(font_names.index_of(parent_window.config.config_file.get_value("general", "font"))); + window_combox.set_active(window_state_list.index_of(parent_window.config.config_file.get_value("advanced", "use_on_starting"))); + + copy_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "copy")); + paste_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "paste")); + open_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "open")); + search_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "search")); + zoom_in_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "zoom_in")); + zoom_out_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "zoom_out")); + zoom_reset_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "default_size")); + jump_to_next_command_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "jump_to_next_command")); + jump_to_previous_command_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "jump_to_previous_command")); + select_all_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "select_all")); + new_workspace_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "new_workspace")); + close_workspace_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "close_workspace")); + previous_workspace_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "previous_workspace")); + next_workspace_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "next_workspace")); + split_vertically_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "vertical_split")); + split_horizontally_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "horizontal_split")); + select_up_window_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "select_upper_window")); + select_down_window_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "select_lower_window")); + select_left_window_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "select_left_window")); + select_right_window_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "select_right_window")); + close_window_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "close_window")); + close_other_windows_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "close_other_windows")); + fullscreen_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "switch_fullscreen")); + rename_title_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "rename_title")); + display_hotkey_terminal_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "display_shortcuts")); + show_command_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "custom_commands")); + show_remote_manage_key_entry.set_text(parent_window.config.config_file.get_string("shortcut", "remote_management")); + + cursor_style_button.set_cursor_state(parent_window.config.config_file.get_string("advanced", "cursor_shape"));; + + cursor_blink_checkbutton.set_active(parent_window.config.config_file.get_boolean("advanced", "cursor_blink_mode")); + cursor_auto_hide_checkbutton.set_active(parent_window.config.config_file.get_boolean("advanced", "cursor_auto_hide")); + scroll_on_key_checkbutton.set_active(parent_window.config.config_file.get_boolean("advanced", "scroll_on_key")); + scroll_on_out_checkbutton.set_active(parent_window.config.config_file.get_boolean("advanced", "scroll_on_output")); + blur_background_checkbutton.set_active(parent_window.config.config_file.get_boolean("advanced", "blur_background")); + hide_quakewindow_after_lost_focus_checkbutton.set_active(parent_window.config.config_file.get_boolean("advanced", "hide_quakewindow_after_lost_focus")); + + font_size_spinbutton.set_value(parent_window.config.config_file.get_integer("general", "font_size")); + } catch (GLib.KeyFileError e) { + print("Preference init_config: %s\n", e.message); + } + + } + public bool item_in_visible_area(Gtk.Widget item) { - int widget_x, widget_y; + int widget_x, widget_y; content_box.translate_coordinates(item, 0, 0, out widget_x, out widget_y); - + return Math.fabs(widget_y) > scrolledwindow.get_vadjustment().get_value() - segment_margin_top * 2; } - + public void scroll_to_widget(ScrolledWindow scrolledwindow, Gtk.Box box, Gtk.Widget widget) { - int widget_x, widget_y; - content_box.translate_coordinates(widget, 0, 0, out widget_x, out widget_y); - + int widget_x, widget_y; + content_box.translate_coordinates(widget, 0, 0, out widget_x, out widget_y); + var adjust = scrolledwindow.get_vadjustment(); - timer_start_value= adjust.get_value(); + timer_start_value= adjust.get_value(); timer_end_value = Math.fabs(widget_y); - + in_animation = true; - timer.reset(); - } - - public void on_animate(double progress) { - var adjust = scrolledwindow.get_vadjustment(); - adjust.set_value(timer_start_value + (timer_end_value - timer_start_value) * progress); - - if (progress >= 1.0) { - timer.stop(); + timer.reset(); + } + + public void on_animate(double progress) { + var adjust = scrolledwindow.get_vadjustment(); + adjust.set_value(timer_start_value + (timer_end_value - timer_start_value) * progress); + + if (progress >= 1.0) { + timer.stop(); in_animation = false; - } - } - - public Gtk.Widget get_first_segment(string name) { + } + } + + public Gtk.Widget get_first_segment(string name) { var segment = create_label(); segment.get_style_context().add_class("preference_first_segment"); segment.set_text(name); segment.set_xalign(0); - + var box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); box.pack_start(segment, false, false, 0); - + var line = new Gtk.EventBox(); line.margin_start = preference_split_line_margin_left; line.draw.connect((w, cr) => { Gtk.Allocation rect; this.get_allocation(out rect); - + cr.set_source_rgba(0, 0, 0, 0.1); Draw.draw_rectangle(cr, 0, 12, rect.width, 1); - + return true; }); box.pack_start(line, true, true, 0); - + box.margin_top = segment_margin_top; box.margin_bottom = segment_margin_bottom; box.margin_start = first_segment_margin_left; @@ -594,148 +594,148 @@ return (Gtk.Widget) segment; } - + public void create_key_row(Gtk.Label label, ShortcutEntry entry, string name, Gtk.Grid grid, string? group_name=null, string? key=null) { - label.set_text(name); - label.get_style_context().add_class("preference_title"); + label.set_text(name); + label.get_style_context().add_class("preference_title"); + + monitor_check_key(entry, group_name, key); - monitor_check_key(entry, group_name, key); - adjust_option_widgets(label, entry); grid_attach(grid, label, 0, 0, preference_name_width, grid_height); grid_attach_next_to(grid, entry, label, Gtk.PositionType.RIGHT, preference_widget_width, grid_height); - } - + } + public void create_follow_key_row(Gtk.Label label, ShortcutEntry entry, string name, Gtk.Label previous_label, Gtk.Grid grid, string? group_name=null, string? key=null) { - label.set_text(name); - label.get_style_context().add_class("preference_title"); - - monitor_check_key(entry, group_name, key); - + label.set_text(name); + label.get_style_context().add_class("preference_title"); + + monitor_check_key(entry, group_name, key); + adjust_option_widgets(label, entry); grid_attach_next_to(grid, label, previous_label, Gtk.PositionType.BOTTOM, preference_name_width, grid_height); grid_attach_next_to(grid, entry, label, Gtk.PositionType.RIGHT, preference_widget_width, grid_height); - } - - public void monitor_check_key(ShortcutEntry entry, string group_name, string key) { + } + + public void monitor_check_key(ShortcutEntry entry, string group_name, string key) { entry.change_key.connect((e, new_key) => { parent_window.config.load_config(); - parent_window.config.config_file.set_string(group_name, key, new_key); - parent_window.config.save(); - - parent_window.config.update(); - }); - - if (group_name != null && key != null) { - try { - entry.set_text(parent_window.config.config_file.get_string(group_name, key)); - } catch (GLib.KeyFileError e) { - print("Preference monitor_check_key: %s\n", e.message); - } - } - } - + parent_window.config.config_file.set_string(group_name, key, new_key); + parent_window.config.save(); + + parent_window.config.update(); + }); + + if (group_name != null && key != null) { + try { + entry.set_text(parent_window.config.config_file.get_string(group_name, key)); + } catch (GLib.KeyFileError e) { + print("Preference monitor_check_key: %s\n", e.message); + } + } + } + public void create_combox_row(Gtk.Label label, Widgets.DropdownTextButton combox, string name, Gtk.Grid grid, ArrayList? values=null, string? group_name=null, string? key=null) { - label.set_text(name); - label.get_style_context().add_class("preference_title"); + label.set_text(name); + label.get_style_context().add_class("preference_title"); - if (values != null) { + if (values != null) { foreach (string value in values) { combox.append(value, value); } - + try { combox.set_active(values.index_of(parent_window.config.config_file.get_value(group_name, key))); } catch (GLib.KeyFileError e) { print("create_combox_row error: %s\n".printf(e.message)); } - + combox.changed.connect((w) => { parent_window.config.load_config(); parent_window.config.config_file.set_string(group_name, key, values[combox.get_active()]); parent_window.config.save(); - - parent_window.config.update(); + + parent_window.config.update(); }); } adjust_option_widgets(label, combox); grid_attach(grid, label, 0, 0, preference_name_width, grid_height); grid_attach_next_to(grid, combox, label, Gtk.PositionType.RIGHT, preference_widget_width, grid_height); - } + } public void create_combox_row_with_name(Gtk.Label label, Widgets.DropdownTextButton combox, string name, Gtk.Grid grid, ArrayList? values=null, ArrayList? names=null, string? group_name=null, string? key=null) { - label.set_text(name); - label.get_style_context().add_class("preference_title"); + label.set_text(name); + label.get_style_context().add_class("preference_title"); - if (values != null) { + if (values != null) { int index = 0; foreach (string value in values) { combox.append(value, names[index]); index++; } - + try { combox.set_active(values.index_of(parent_window.config.config_file.get_value(group_name, key))); } catch (GLib.KeyFileError e) { print("create_combox_row error: %s\n".printf(e.message)); } - + combox.changed.connect((w) => { parent_window.config.load_config(); parent_window.config.config_file.set_string(group_name, key, values[combox.get_active()]); parent_window.config.save(); - - parent_window.config.update(); + + parent_window.config.update(); }); } adjust_option_widgets(label, combox); grid_attach(grid, label, 0, 0, preference_name_width, grid_height); grid_attach_next_to(grid, combox, label, Gtk.PositionType.RIGHT, preference_widget_width, grid_height); - } + } public void adjust_option_widgets(Gtk.Label name_widget, Gtk.Widget value_widget) { name_widget.set_xalign(0); name_widget.set_size_request(preference_name_width, grid_height); name_widget.margin_start = option_widget_margin_left; - + value_widget.set_size_request(preference_widget_width, grid_height); value_widget.margin_end = option_widget_margin_right; // NOTE: // set_hexpand is very important to make widget in grid to expand space horizaontally. value_widget.set_hexpand(true); } - + public Gtk.Box create_check_row(Widgets.CheckButton checkbutton, string name, Gtk.Grid grid, string? group_name=null, string? key=null) { var box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); var label = create_label(name); - label.get_style_context().add_class("preference_title"); + label.get_style_context().add_class("preference_title"); adjust_option_checkbutton(label, checkbutton); read_check_value(checkbutton, group_name, key); - + box.pack_start(checkbutton, false, false, 0); box.pack_start(label, false, false, 0); grid_attach(grid, box, 0, 0, preference_name_width, grid_height); - + return box; } - + public Gtk.Box create_follow_check_row(Widgets.CheckButton checkbutton, string name, Gtk.Widget previous_widget, Gtk.Grid grid, string? group_name=null, string? key=null) { var box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); - var label = create_label(name); - label.get_style_context().add_class("preference_title"); + var label = create_label(name); + label.get_style_context().add_class("preference_title"); + + adjust_option_checkbutton(label, checkbutton); - adjust_option_checkbutton(label, checkbutton); - read_check_value(checkbutton, group_name, key); - + box.pack_start(checkbutton, false, false, 0); box.pack_start(label, false, false, 0); grid_attach_next_to(grid, box, previous_widget, Gtk.PositionType.BOTTOM, preference_name_width, grid_height); - + return box; } - + public void read_check_value(Widgets.CheckButton checkbutton, string group_name, string key) { if (group_name != null && key != null) { try { @@ -743,24 +743,24 @@ } catch (GLib.KeyFileError e) { print("create_follow_check_row error: %s\n".printf(e.message)); } - + monitor_check_value(checkbutton, group_name, key); } } - + public Gtk.Label create_follow_spinbutton_row(Widgets.SpinButton spinbutton, string name, Gtk.Widget previous_widget, Gtk.Grid grid, string? group_name=null, string? key=null) { var label = create_label(name); - label.get_style_context().add_class("preference_title"); + label.get_style_context().add_class("preference_title"); adjust_option_widgets(label, spinbutton); - + read_spin_value(spinbutton, group_name, key); - + grid_attach_next_to(grid, label, previous_widget, Gtk.PositionType.BOTTOM, preference_name_width, grid_height); grid_attach_next_to(grid, spinbutton, label, Gtk.PositionType.RIGHT, preference_widget_width, grid_height); - + return label; } - + public void read_spin_value(Widgets.SpinButton spinbutton, string group_name, string key) { if (group_name != null && key != null) { try { @@ -768,19 +768,19 @@ } catch (GLib.KeyFileError e) { print("read_spin_value error: %s\n".printf(e.message)); } - + monitor_spin_value(spinbutton, group_name, key); } } - + public void monitor_check_value(Widgets.CheckButton checkbutton, string group_name, string key) { checkbutton.toggled.connect((w) => { var is_active = checkbutton.get_active(); - + parent_window.config.load_config(); parent_window.config.config_file.set_boolean(group_name, key, is_active); parent_window.config.save(); - + parent_window.config.update(); }); } @@ -788,48 +788,48 @@ public void monitor_spin_value(Widgets.SpinButton spinbutton, string group_name, string key) { spinbutton.value_changed.connect((w) => { var spin_value = spinbutton.get_value(); - + parent_window.config.load_config(); parent_window.config.config_file.set_integer(group_name, key, (int) spin_value); parent_window.config.save(); - + parent_window.config.update(); }); } - + public void adjust_option_checkbutton(Gtk.Label label, Widgets.CheckButton checkbutton) { checkbutton.margin_start = option_widget_margin_left; checkbutton.margin_top = checkbutton_margin_top; checkbutton.margin_end = checkbutton_margin_right; } - + public Widgets.Entry create_entry() { var entry = new Widgets.Entry(); entry.get_style_context().add_class("preference_entry"); - + return entry; } - + public Widgets.DropdownTextButton create_combox_text() { var combox = new Widgets.DropdownTextButton(); combox.get_style_context().add_class("preference_comboboxtext"); - + return combox; } - + public Widgets.SpinButton create_spinbutton(int min, int max, int step) { var spinbutton = new Widgets.SpinButton(); - spinbutton.set_range(min, max); + spinbutton.set_range(min, max); spinbutton.set_increments(step, step * 10); spinbutton.get_style_context().add_class("preference_spinbutton"); - + return spinbutton; } public Gtk.Label create_label(string? text=null) { var label = new Gtk.Label(text); label.get_style_context().add_class("preference_label"); - + return label; } } diff -Nru deepin-terminal-3.0.3+ds/widget/progressbar.vala deepin-terminal-3.0.7/widget/progressbar.vala --- deepin-terminal-3.0.3+ds/widget/progressbar.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/progressbar.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,16 +19,16 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; namespace Widgets { - public class ProgressBar : Gtk.EventBox { - public double draw_percent; - public double percent; - public int height = 22; + public class ProgressBar : Gtk.EventBox { + public double draw_percent; + public double percent; + public int height = 22; public Cairo.ImageSurface pointer_surface; public Gdk.RGBA background_color; public Gdk.RGBA foreground_color; @@ -36,56 +36,56 @@ public int line_height = 2; public int line_margin_top = 10; public int width = Constant.PREFERENCE_WIDGET_WIDTH; - - public signal void update(double percent); - - public ProgressBar(double init_percent) { - percent = init_percent; - set_size_request(width, height); - + + public signal void update(double percent); + + public ProgressBar(double init_percent) { + percent = init_percent; + set_size_request(width, height); + foreground_color = Utils.hex_to_rgba("#2ca7f8"); background_color = Utils.hex_to_rgba("#A4A4A4"); pointer_surface = Utils.create_image_surface("progress_pointer.svg"); - + button_press_event.connect((w, e) => { - Gtk.Allocation rect; - w.get_allocation(out rect); - - set_percent(e.x * 1.0 / rect.width); - + Gtk.Allocation rect; + w.get_allocation(out rect); + + set_percent(e.x * 1.0 / rect.width); + return false; - }); - + }); + motion_notify_event.connect((w, e) => { - Gtk.Allocation rect; - w.get_allocation(out rect); - - set_percent(e.x * 1.0 / rect.width); - - return false; + Gtk.Allocation rect; + w.get_allocation(out rect); + + set_percent(e.x * 1.0 / rect.width); + + return false; }); - - draw.connect(on_draw); - - show_all(); - } - - public void set_percent(double new_percent) { + + draw.connect(on_draw); + + show_all(); + } + + public void set_percent(double new_percent) { percent = double.max(double.min((1 - Constant.TERMINAL_MIN_OPACITY) * new_percent + Constant.TERMINAL_MIN_OPACITY, 1), Constant.TERMINAL_MIN_OPACITY); draw_percent = double.max(double.min(new_percent, 1), 0); update(percent); - - queue_draw(); - } - - private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { + + queue_draw(); + } + + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { Gtk.Allocation rect; widget.get_allocation(out rect); int left_offset = 0; int right_offset = 0; - + // Because pointer surface opacity at side. // So we adjust background line offset to avoid user see background line at two side when percent is 0 or 1. if (draw_percent == 0) { @@ -95,24 +95,24 @@ left_offset = 0; right_offset = draw_pointer_offset; } - + Utils.set_context_color(cr, background_color); - Draw.draw_rectangle(cr, left_offset, line_margin_top, rect.width - right_offset, line_height); - + Draw.draw_rectangle(cr, left_offset, line_margin_top, rect.width - right_offset, line_height); + if (draw_percent > 0) { cr.set_source_rgba(1, 0, 1, 1); Utils.set_context_color(cr, foreground_color); Draw.draw_rectangle(cr, left_offset, line_margin_top, (int) (rect.width * draw_percent) - right_offset, line_height); } - + Draw.draw_surface(cr, pointer_surface, int.max(-draw_pointer_offset, - int.min((int) (rect.width * draw_percent) - pointer_surface.get_width() / 2 / 2, - rect.width - pointer_surface.get_width() + draw_pointer_offset)), + int.min((int) (rect.width * draw_percent) - pointer_surface.get_width() / 2 / 2, + rect.width - pointer_surface.get_width() + draw_pointer_offset)), 0); - + return true; } - } + } } diff -Nru deepin-terminal-3.0.3+ds/widget/quake_window.vala deepin-terminal-3.0.7/widget/quake_window.vala --- deepin-terminal-3.0.3+ds/widget/quake_window.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/quake_window.vala 2018-10-06 18:03:56.000000000 +0000 @@ -130,7 +130,7 @@ }); configure_event.connect((w) => { - // Update input shape. + // Update input shape. int width, height; get_size(out width, out height); @@ -146,9 +146,9 @@ var shape = new Cairo.Region.rectangle(input_shape_rect); get_window().input_shape_combine_region(shape, 0, 0); - - // Update blur area. - update_blur_status(); + + // Update blur area. + update_blur_status(); window_save_before_quit(); @@ -215,66 +215,66 @@ config.update.connect((w) => { update_style(); - - update_blur_status(true); + + update_blur_status(true); }); } - - public void update_blur_status(bool force_update=false) { - try { - int width, height; - get_size(out width, out height); - - if (width != resize_cache_width || height != resize_cache_height || force_update) { - resize_cache_width = width; - resize_cache_height = height; - - unowned X.Display xdisplay = (get_window().get_display() as Gdk.X11.Display).get_xdisplay(); - var xid = (int)((Gdk.X11.Window) get_window()).get_xid(); - var atom_NET_WM_DEEPIN_BLUR_REGION_ROUNDED = xdisplay.intern_atom("_NET_WM_DEEPIN_BLUR_REGION_ROUNDED", false); - - var blur_background = config.config_file.get_boolean("advanced", "blur_background"); - if (blur_background) { - Cairo.RectangleInt blur_rect; - get_window().get_frame_extents(out blur_rect); - - if (screen_monitor.is_composited()) { - blur_rect.x = 0; - blur_rect.y = 0; - blur_rect.width = width; - blur_rect.height = height - window_frame_box.margin_bottom; - } - - blur_rect.x = (int) (blur_rect.x * Utils.get_default_monitor_scale()); - blur_rect.y = (int) (blur_rect.y * Utils.get_default_monitor_scale()); - blur_rect.width = (int) (blur_rect.width * Utils.get_default_monitor_scale()); - blur_rect.height = (int) (blur_rect.height * Utils.get_default_monitor_scale()); - - ulong[] data = {(ulong) blur_rect.x, (ulong) blur_rect.y, (ulong) blur_rect.width, (ulong) blur_rect.height, 8, 8}; - xdisplay.change_property( - xid, - atom_NET_WM_DEEPIN_BLUR_REGION_ROUNDED, - X.XA_CARDINAL, - 32, - X.PropMode.Replace, - (uchar[])data, - ((ulong[]) data).length); - } else { - ulong[] data = {0, 0, 0, 0, 0, 0}; - xdisplay.change_property( - xid, - atom_NET_WM_DEEPIN_BLUR_REGION_ROUNDED, - X.XA_CARDINAL, - 32, - X.PropMode.Replace, - (uchar[])data, - ((ulong[]) data).length); - } - } - } catch (GLib.KeyFileError e) { - print("%s\n", e.message); - } - } + + public void update_blur_status(bool force_update=false) { + try { + int width, height; + get_size(out width, out height); + + if (width != resize_cache_width || height != resize_cache_height || force_update) { + resize_cache_width = width; + resize_cache_height = height; + + unowned X.Display xdisplay = (get_window().get_display() as Gdk.X11.Display).get_xdisplay(); + var xid = (int)((Gdk.X11.Window) get_window()).get_xid(); + var atom_NET_WM_DEEPIN_BLUR_REGION_ROUNDED = xdisplay.intern_atom("_NET_WM_DEEPIN_BLUR_REGION_ROUNDED", false); + + var blur_background = config.config_file.get_boolean("advanced", "blur_background"); + if (blur_background) { + Cairo.RectangleInt blur_rect; + get_window().get_frame_extents(out blur_rect); + + if (screen_monitor.is_composited()) { + blur_rect.x = 0; + blur_rect.y = 0; + blur_rect.width = width; + blur_rect.height = height - window_frame_box.margin_bottom; + } + + blur_rect.x = (int) (blur_rect.x * Utils.get_default_monitor_scale()); + blur_rect.y = (int) (blur_rect.y * Utils.get_default_monitor_scale()); + blur_rect.width = (int) (blur_rect.width * Utils.get_default_monitor_scale()); + blur_rect.height = (int) (blur_rect.height * Utils.get_default_monitor_scale()); + + ulong[] data = {(ulong) blur_rect.x, (ulong) blur_rect.y, (ulong) blur_rect.width, (ulong) blur_rect.height, 8, 8}; + xdisplay.change_property( + xid, + atom_NET_WM_DEEPIN_BLUR_REGION_ROUNDED, + X.XA_CARDINAL, + 32, + X.PropMode.Replace, + (uchar[])data, + ((ulong[]) data).length); + } else { + ulong[] data = {0, 0, 0, 0, 0, 0}; + xdisplay.change_property( + xid, + atom_NET_WM_DEEPIN_BLUR_REGION_ROUNDED, + X.XA_CARDINAL, + 32, + X.PropMode.Replace, + (uchar[])data, + ((ulong[]) data).length); + } + } + } catch (GLib.KeyFileError e) { + print("%s\n", e.message); + } + } public void add_widget(Gtk.Widget widget) { window_widget_box.pack_start(widget, true, true, 0); @@ -401,10 +401,10 @@ int width = window_frame_rect.width; int height = window_frame_rect.height; - int titlebar_y = y; - if (get_scale_factor() > 1) { - titlebar_y += 1; - } + int titlebar_y = y; + if (get_scale_factor() > 1) { + titlebar_y += 1; + } draw_titlebar_underline(cr, x, titlebar_y + height - Constant.TITLEBAR_HEIGHT - 1, width, -1); draw_active_tab_underline(cr, x + active_tab_underline_x, titlebar_y + height - Constant.TITLEBAR_HEIGHT - 1); diff -Nru deepin-terminal-3.0.3+ds/widget/remote_panel.vala deepin-terminal-3.0.7/widget/remote_panel.vala --- deepin-terminal-3.0.3+ds/widget/remote_panel.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/remote_panel.vala 2018-10-06 18:03:56.000000000 +0000 @@ -166,25 +166,25 @@ } public void login_server(string server_info) { - // Hide remote panel first. - workspace.hide_remote_panel(); - if (focus_widget != null) { - focus_widget.grab_focus(); - } - - // New workspace if focus terminal has foreground process. - Term focus_term = workspace_manager.focus_workspace.get_focus_term(workspace_manager.focus_workspace); - if (focus_term.has_foreground_process()) { - workspace_manager.new_workspace_with_current_directory(true); - } - - // Login server in timeout callback, otherwise login action can't execute. - GLib.Timeout.add(10, () => { - Term term = workspace_manager.focus_workspace.get_focus_term(workspace_manager.focus_workspace); - term.login_server(server_info); + // Hide remote panel first. + workspace.hide_remote_panel(); + if (focus_widget != null) { + focus_widget.grab_focus(); + } + + // New workspace if focus terminal has foreground process. + Term focus_term = workspace_manager.focus_workspace.get_focus_term(workspace_manager.focus_workspace); + if (focus_term.has_foreground_process()) { + workspace_manager.new_workspace_with_current_directory(true); + } - return false; - }); + // Login server in timeout callback, otherwise login action can't execute. + GLib.Timeout.add(10, () => { + Term term = workspace_manager.focus_workspace.get_focus_term(workspace_manager.focus_workspace); + term.login_server(server_info); + + return false; + }); } public void show_group_page(string group_name, Gtk.Widget start_widget, string directoin) { @@ -497,4 +497,4 @@ show_all(); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/remote_server_dialog.vala deepin-terminal-3.0.7/widget/remote_server_dialog.vala --- deepin-terminal-3.0.3+ds/widget/remote_server_dialog.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/remote_server_dialog.vala 2018-10-06 18:03:56.000000000 +0000 @@ -198,7 +198,7 @@ address_entry.get_style_context().add_class("preference_entry"); Label port_label = create_label(_("Port:")); port_spinbutton = new Widgets.SpinButton(); - + port_spinbutton.set_range(0, 65535); port_spinbutton.set_increments(1, 10); port_spinbutton.get_style_context().add_class("preference_spinbutton"); @@ -487,4 +487,4 @@ value_widget.set_hexpand(true); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/rename_dialog.vala deepin-terminal-3.0.7/widget/rename_dialog.vala --- deepin-terminal-3.0.3+ds/widget/rename_dialog.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/rename_dialog.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -35,19 +35,19 @@ private int logo_margin_end = 20; private int logo_margin_start = 20; private int title_margin_top = 7; - + public signal void cancel(); public signal void rename(string new_title); - + public RenameDialog(string title, string content, string cancel_text, string rename_text) { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); - + set_init_size(480, 230); - + // Add widgets. var overlay = new Gtk.Overlay(); var box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); - + var close_button = Widgets.create_close_button(); close_button.clicked.connect((b) => { this.destroy(); @@ -59,11 +59,11 @@ content_button_box.margin_top = box_margin_top; content_button_box.margin_bottom = box_margin_bottom; content_button_box.margin_end = box_margin_end; - + Gtk.Image logo_image = new Gtk.Image.from_file(Utils.get_image_path("dialog_icon.svg")); logo_image.margin_start = logo_margin_start; logo_image.margin_end = logo_margin_end; - + var label_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); Label title_label = new Gtk.Label(null); title_label.set_halign(Gtk.Align.START); @@ -75,12 +75,12 @@ title_entry.set_text(content); title_entry.margin_top = content_margin_top; title_entry.get_style_context().add_class("preference_entry"); - + title_entry.activate.connect((entry) => { rename(entry.get_text()); destroy(); }); - + Box button_box = new Box(Gtk.Orientation.HORIZONTAL, 0); if (cancel_text != "") { cancel_button = new Widgets.DialogButton(cancel_text, "left", "text", screen_monitor.is_composited()); @@ -98,7 +98,7 @@ rename(title_entry.get_text()); destroy(); }); - + var tab_order_list = new List(); tab_order_list.append((Gtk.Widget) title_entry); if (cancel_text != "") { @@ -107,7 +107,7 @@ tab_order_list.append((Gtk.Widget) rename_button); button_box.set_focus_chain(tab_order_list); button_box.set_focus_child(title_entry); - + close_button_box.pack_start(close_button, true, true, 0); label_box.pack_start(title_label, false, false, 0); label_box.pack_start(title_entry, false, false, 0); @@ -120,7 +120,7 @@ box.pack_start(close_button_box, false, false, 0); box.pack_start(content_button_box, true, true, 0); box.pack_start(button_box, true, true, 0); - + var event_area = new Widgets.WindowEventArea(this); event_area.margin_end = Constant.CLOSE_BUTTON_WIDTH; if (screen_monitor.is_composited()) { @@ -128,11 +128,11 @@ } else { event_area.margin_bottom = window_init_height - Constant.TITLEBAR_HEIGHT; } - + overlay.add(box); overlay.add_overlay(event_area); - + add_widget(overlay); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/search_entry.vala deepin-terminal-3.0.7/widget/search_entry.vala --- deepin-terminal-3.0.3+ds/widget/search_entry.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/search_entry.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Animation; using Gtk; @@ -27,7 +27,7 @@ namespace Widgets { public class SearchEntry : Gtk.EventBox { - public AnimateTimer timer; + public AnimateTimer timer; public Gtk.Box box; public Gtk.Box display_box; public Gtk.Label search_label; @@ -40,7 +40,7 @@ public int search_image_animate_start_x; public int search_image_margin_right = 5; public int search_image_margin_x = 18; - + public SearchEntry() { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); @@ -49,13 +49,13 @@ | Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.LEAVE_NOTIFY_MASK); set_size_request(-1, height); - - timer = new AnimateTimer(AnimateTimer.ease_in_out, animation_time); - timer.animate.connect(on_animate); - + + timer = new AnimateTimer(AnimateTimer.ease_in_out, animation_time); + timer.animate.connect(on_animate); + box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); display_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); - + search_image = new ImageButton("search", true); search_image.margin_end = search_image_margin_right; search_image.set_valign(Gtk.Align.CENTER); @@ -64,72 +64,72 @@ search_label.set_text(_("Search")); search_entry = new Widgets.Entry(); search_entry.set_placeholder_text(_("Search")); - clear_button = new ImageButton("search_clear", true); + clear_button = new ImageButton("search_clear", true); clear_button.margin_right = clear_button_margin_right; clear_button.set_valign(Gtk.Align.CENTER); clear_button.clicked.connect((w, e) => { search_entry.set_text(""); }); - + switch_to_display(); - + realize.connect((w) => { bool is_light_theme = ((Widgets.ConfigWindow) get_toplevel()).is_light_theme(); if (is_light_theme) { - search_entry.get_style_context().add_class("remote_search_light_entry"); + search_entry.get_style_context().add_class("remote_search_light_entry"); search_label.get_style_context().add_class("remote_search_label_light"); } else { - search_entry.get_style_context().add_class("remote_search_dark_entry"); + search_entry.get_style_context().add_class("remote_search_dark_entry"); search_label.get_style_context().add_class("remote_search_label_dark"); } }); - + button_press_event.connect((w, e) => { display_box.set_halign(Gtk.Align.START); display_box.remove(search_label); - + this.translate_coordinates(search_image, 0, 0, out search_image_animate_start_x, null); search_image_animate_start_x = search_image_animate_start_x.abs() - search_image_margin_x; search_image.margin_left = search_image_margin_x + search_image_animate_start_x; - + timer.reset(); - + return false; }); - + key_press_event.connect((w, e) => { string keyname = Keymap.get_keyevent_name(e); if (keyname == "Esc") { switch_to_display(); } - + return false; }); - + add(box); } - + public void on_animate(double progress) { search_image.margin_left = search_image_margin_x + (int) (search_image_animate_start_x * (1.0 - progress)); - - if (progress >= 1.0) { - timer.stop(); + + if (progress >= 1.0) { + timer.stop(); switch_to_input(); - } - } - + } + } + public void switch_to_display() { Utils.remove_all_children(box); - + search_image.margin_left = 0; display_box.pack_start(search_image, false, false, 0); display_box.pack_start(search_label, false, false, 0); display_box.set_halign(Gtk.Align.CENTER); box.pack_start(display_box, true, true, 0); - + show_all(); } - + public void switch_to_input() { Utils.remove_all_children(box); Utils.remove_all_children(display_box); @@ -137,11 +137,11 @@ box.pack_start(search_image, false, false, 0); box.pack_start(search_entry, true, true, 0); box.pack_start(clear_button, false, false, 0); - + search_image.margin_left = search_image_margin_x; search_entry.grab_focus(); - + show_all(); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/search_panel.vala deepin-terminal-3.0.7/widget/search_panel.vala --- deepin-terminal-3.0.3+ds/widget/search_panel.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/search_panel.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -36,60 +36,60 @@ public int button_margin = 4; public int margin_horizontal = 10; public string search_text; - + public signal void quit_search(); - + public SearchPanel(Widgets.ConfigWindow config_window, Term term, string init_search_text) { terminal = term; search_text = init_search_text; - + search_image = new ImageButton("search", true); search_entry = new Widgets.Entry(); clear_button_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); clear_button = new ImageButton("search_clear", true); search_next_button = new ImageButton("search_next", true); search_previous_button = new ImageButton("search_previous", true); - + search_entry.set_text(init_search_text); - + pack_start(search_image, false, false, 0); pack_start(search_entry, true, true, 0); pack_start(clear_button_box, false, false, 0); pack_start(search_previous_button, false, false, 0); pack_start(search_next_button, false, false, 0); - + search_image.set_valign(Gtk.Align.CENTER); search_entry.set_valign(Gtk.Align.CENTER); search_next_button.set_valign(Gtk.Align.CENTER); search_previous_button.set_valign(Gtk.Align.CENTER); clear_button_box.set_valign(Gtk.Align.CENTER); - + search_image.margin_start = margin_horizontal; clear_button_box.margin_end = margin_horizontal; search_previous_button.margin_end = margin_horizontal; search_entry.margin_end = button_margin; search_next_button.margin_end = button_margin; - + set_size_request(Constant.SEARCH_PANEL_WIDTH, Constant.TITLEBAR_HEIGHT); set_valign(Gtk.Align.START); set_halign(Gtk.Align.END); - + adjust_css_with_theme(config_window); realize.connect((w) => { ((Widgets.ConfigWindow) this.get_toplevel()).config.update.connect((w) => { adjust_css_with_theme(config_window); }); }); - + search_entry.key_press_event.connect((w, e) => { string keyname = Keymap.get_keyevent_name(e); - + if (keyname == "Esc") { quit_search(); } else if (keyname == "Enter") { update_search_text(); } - + return false; }); search_entry.get_buffer().deleted_text.connect((buffer, p, nc) => { @@ -97,7 +97,7 @@ if (entry_text == "") { hide_clear_button(); } - + update_search_text(); }); search_entry.get_buffer().inserted_text.connect((buffer, p, c, nc) => { @@ -110,7 +110,7 @@ clear_button.button_press_event.connect((w, e) => { search_entry.set_text(""); update_search_text(); - + return false; }); search_entry.activate.connect((w) => { @@ -123,7 +123,7 @@ update_search_text(); terminal.term.search_find_next(); } - + return false; }); search_previous_button.button_press_event.connect((w, e) => { @@ -131,20 +131,20 @@ update_search_text(); terminal.term.search_find_previous(); } - + return false; }); } - + public void update_search_text() { string entry_text = search_entry.get_text().strip(); search_text = entry_text; - + try { GLib.RegexCompileFlags flags = GLib.RegexCompileFlags.OPTIMIZE; flags |= GLib.RegexCompileFlags.CASELESS; string pattern = GLib.Regex.escape_string(search_text); - + var regex = new Regex(pattern, flags, 0); terminal.term.search_set_gregex(regex, 0); terminal.term.search_set_wrap_around(true); @@ -156,12 +156,12 @@ public void adjust_css_with_theme(Widgets.ConfigWindow config_window) { bool is_light_theme = config_window.is_light_theme(); - + get_style_context().remove_class("search_light_box"); get_style_context().remove_class("search_dark_box"); search_entry.get_style_context().remove_class("search_dark_entry"); search_entry.get_style_context().remove_class("search_light_entry"); - + if (is_light_theme) { search_entry.get_style_context().add_class("search_light_entry"); get_style_context().add_class("search_light_box"); @@ -170,16 +170,16 @@ get_style_context().add_class("search_dark_box"); } } - + public void show_clear_button() { if (clear_button_box.get_children().length() == 0) { clear_button_box.add(clear_button); show_all(); } } - + public void hide_clear_button() { Utils.remove_all_children(clear_button_box); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/server_button.vala deepin-terminal-3.0.7/widget/server_button.vala --- deepin-terminal-3.0.3+ds/widget/server_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/server_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -28,7 +28,7 @@ public class ServerButton : Widgets.PanelButton { public signal void edit_server(string server_info); public signal void login_server(string server_info); - + public ServerButton(string server_title, string server_content) { string[] server_infos = server_content.split("@"); string display_name = ""; @@ -37,9 +37,9 @@ } else { display_name = "%s@%s".printf(server_infos[0], server_infos[1]); } - + base(server_title, server_content, display_name, "server"); - + click_edit_button.connect((w) => { edit_server(server_content); }); @@ -48,4 +48,4 @@ }); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/server_group_button.vala deepin-terminal-3.0.7/widget/server_group_button.vala --- deepin-terminal-3.0.3+ds/widget/server_group_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/server_group_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -54,23 +54,23 @@ public int title_y = 5; public int width = Constant.SLIDER_WIDTH; public string title; - + public signal void show_group_servers(string group_name); - + public ServerGroupButton(string server_title, int number) { this.add_events(Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK | Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.LEAVE_NOTIFY_MASK); - + title = server_title; server_number = number; - - server_group_dark_surface = Utils.create_image_surface("server_group_dark.svg"); - server_group_light_surface = Utils.create_image_surface("server_group_light.svg"); - arrow_dark_surface = Utils.create_image_surface("list_arrow_dark.svg"); - arrow_light_surface = Utils.create_image_surface("list_arrow_light.svg"); - + + server_group_dark_surface = Utils.create_image_surface("server_group_dark.svg"); + server_group_light_surface = Utils.create_image_surface("server_group_light.svg"); + arrow_dark_surface = Utils.create_image_surface("list_arrow_dark.svg"); + arrow_light_surface = Utils.create_image_surface("list_arrow_light.svg"); + title_dark_color = Utils.hex_to_rgba("#FFFFFF"); content_dark_color = Utils.hex_to_rgba("#FFFFFF", 0.5); press_dark_color = Utils.hex_to_rgba("#FFFFFF", 0.1); @@ -83,39 +83,39 @@ line_light_color = Utils.hex_to_rgba("#000000", 0.05); set_size_request(width, height); - + draw.connect(on_draw); - enter_notify_event.connect((w, e) => { - is_hover = true; - queue_draw(); - - return false; - }); - leave_notify_event.connect((w, e) => { - is_hover = false; - queue_draw(); - - return false; - }); - button_press_event.connect((w, e) => { - queue_draw(); - - return false; - }); - button_release_event.connect((w, e) => { + enter_notify_event.connect((w, e) => { + is_hover = true; + queue_draw(); + + return false; + }); + leave_notify_event.connect((w, e) => { + is_hover = false; + queue_draw(); + + return false; + }); + button_press_event.connect((w, e) => { + queue_draw(); + + return false; + }); + button_release_event.connect((w, e) => { is_hover = false; - queue_draw(); - - return false; - }); + queue_draw(); + + return false; + }); clicked.connect((w, e) => { show_group_servers(server_title); }); } - + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { bool is_light_theme = ((Widgets.ConfigWindow) get_toplevel()).is_light_theme(); - + if (is_light_theme) { Draw.draw_surface(cr, server_group_light_surface, image_x, 0, 0, height); Draw.draw_surface(cr, arrow_light_surface, arrow_x, 0, 0, height); @@ -123,8 +123,8 @@ Draw.draw_surface(cr, server_group_dark_surface, image_x, 0, 0, height); Draw.draw_surface(cr, arrow_dark_surface, arrow_x, 0, 0, height); } - - + + if (is_light_theme) { Utils.set_context_color(cr, title_light_color); } else { @@ -144,7 +144,7 @@ content = "1 server"; } Draw.draw_text(cr, content, text_x, content_y, text_width, height, content_size, Pango.Alignment.LEFT, "top"); - + if (display_bottom_line) { if (is_light_theme) { Utils.set_context_color(cr, line_light_color); @@ -153,7 +153,7 @@ } Draw.draw_rectangle(cr, 8, height - 1, width - 16, 1); } - + if (is_press) { if (is_light_theme) { Utils.set_context_color(cr, press_light_color); @@ -169,8 +169,8 @@ } Draw.draw_rectangle(cr, 0, 0, width, height); } - + return true; } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/shortcut_entry.vala deepin-terminal-3.0.7/widget/shortcut_entry.vala --- deepin-terminal-3.0.3+ds/widget/shortcut_entry.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/shortcut_entry.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; @@ -44,43 +44,43 @@ public int shortcut_key_padding_y = 0; public int shortcut_key_spacing = 5; public string shortcut = ""; - + public signal void change_key(string new_key); - + public ShortcutEntry() { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); - - button_left_surface = Utils.create_image_surface("shortcut_button_left.svg"); - button_right_surface = Utils.create_image_surface("shortcut_button_right.svg"); - + + button_left_surface = Utils.create_image_surface("shortcut_button_left.svg"); + button_right_surface = Utils.create_image_surface("shortcut_button_right.svg"); + set_visible_window(false); set_can_focus(true); - + set_size_request(-1, 24); - + normal_frame_color = Gdk.RGBA(); normal_frame_color.red = 0; normal_frame_color.green = 0; normal_frame_color.blue = 0; normal_frame_color.alpha = 0.1; - + active_frame_color = Utils.hex_to_rgba("#2ca7f8"); background_color = Utils.hex_to_rgba("#ffffff"); hint_color = Utils.hex_to_rgba("#ADAEAF"); - + shortcut_background_color = Utils.hex_to_rgba("#69AAFF"); shortcut_background_color.alpha = 0.15; shortcut_frame_color = Utils.hex_to_rgba("#5F9FD9"); shortcut_frame_color.alpha = 0.30; shortcut_font_color = Utils.hex_to_rgba("#303030"); - + draw.connect(on_draw); button_press_event.connect((w, e) => { grab_focus(); - + if (e.type == Gdk.EventType.BUTTON_PRESS) { is_double_clicked = true; - + GLib.Timeout.add(double_clicked_max_delay, () => { is_double_clicked = false; @@ -90,46 +90,46 @@ if (is_double_clicked) { shortcut = ""; change_key(shortcut); - + queue_draw(); } } - + queue_draw(); - + return false; }); key_press_event.connect((w, e) => { string keyname = Keymap.get_keyevent_name(e); - + if (keyname == "Backspace") { shortcut = ""; change_key(shortcut); - + queue_draw(); } else if (keyname == "Ctrl + Tab" || keyname == "Ctrl + Shift + Tab" || keyname == "Shift + Tab") { return false; } else if (keyname.has_prefix("F") || keyname.contains("+")) { shortcut = keyname; change_key(shortcut); - + queue_draw(); } - + return false; }); } - + public void set_text(string text) { shortcut = text; - + queue_draw(); } - + public string get_text() { return shortcut; } - + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { Gtk.Allocation rect; widget.get_allocation(out rect); @@ -139,7 +139,7 @@ } else { Draw.stroke_rounded_rectangle(cr, 0, 0, rect.width, rect.height, 4, normal_frame_color, background_color); } - + if (shortcut == "") { cr.set_source_rgba(hint_color.red, hint_color.green, hint_color.blue, hint_color.alpha); Draw.draw_text( @@ -157,7 +157,7 @@ foreach (string key in shortcut_keys) { var font_description = new Pango.FontDescription(); font_description.set_size((int)(shortcut_font_size * Pango.SCALE)); - + var layout = Pango.cairo_create_layout(cr); layout.set_font_description(font_description); layout.set_text(key, key.length); @@ -167,37 +167,37 @@ int text_width, text_height; layout.get_pixel_size(out text_width, out text_height); - + int key_width = int.max(text_width, 20); int button_width = button_left_surface.get_width() / get_scale_factor(); int button_height = button_left_surface.get_height() / get_scale_factor(); int button_y = (height - button_height) / 2; int shortcut_key_width = key_width + shortcut_key_padding_x * 2; - + Draw.draw_surface(cr, button_left_surface, x, button_y); Draw.draw_surface(cr, button_right_surface, x + shortcut_key_width - button_width, button_y); - + cr.set_source_rgba(shortcut_background_color.red, shortcut_background_color.green, shortcut_background_color.blue, shortcut_background_color.alpha); Draw.draw_rectangle(cr, x + button_width, button_y, shortcut_key_width - button_width * 2, button_height); - + cr.set_source_rgba(shortcut_frame_color.red, shortcut_frame_color.green, shortcut_frame_color.blue, shortcut_frame_color.alpha); Draw.draw_rectangle(cr, x + button_width, button_y, shortcut_key_width - button_width * 2, 1); Draw.draw_rectangle(cr, x + button_width, button_y + button_height - 1, shortcut_key_width - button_width * 2, 1); - + int render_y = y + int.max(0, (height - text_height) / 2); - + cr.set_source_rgba(shortcut_font_color.red, shortcut_font_color.green, shortcut_font_color.blue, shortcut_font_color.alpha); cr.move_to(x + (key_width - text_width) / 2 + shortcut_key_padding_x, render_y); Pango.cairo_update_layout(cr, layout); Pango.cairo_show_layout(cr, layout); - + x += key_width + shortcut_key_spacing + shortcut_key_padding_x * 2; } - + } - + return true; } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/spinbutton.vala deepin-terminal-3.0.7/widget/spinbutton.vala --- deepin-terminal-3.0.3+ds/widget/spinbutton.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/spinbutton.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Utils; @@ -27,23 +27,23 @@ namespace Widgets { public class SpinButton : Gtk.SpinButton { public Widgets.EntryMenu menu; - + public SpinButton() { button_press_event.connect((w, e) => { if (Utils.is_right_button(e)) { menu = new Widgets.EntryMenu(); menu.create_entry_menu(this, (int) e.x_root, (int) e.y_root); - + return true; } - + return false; }); - - // Prevent scroll event. - scroll_event.connect((w, e) => { - return true; - }); + + // Prevent scroll event. + scroll_event.connect((w, e) => { + return true; + }); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/split_line.vala deepin-terminal-3.0.7/widget/split_line.vala --- deepin-terminal-3.0.3+ds/widget/split_line.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/split_line.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; @@ -47,4 +47,4 @@ }); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/switcher.vala deepin-terminal-3.0.7/widget/switcher.vala --- deepin-terminal-3.0.3+ds/widget/switcher.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/switcher.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Animation; using Gtk; @@ -40,16 +40,16 @@ public int scroll_to_right_interval = 500; public int scroll_to_right_start_x; public int width; - + public Switcher(int w) { width = w; - + scroll_to_left_timer = new AnimateTimer(AnimateTimer.ease_out_quint, scroll_to_left_interval); - scroll_to_left_timer.animate.connect(scroll_to_left_animate); + scroll_to_left_timer.animate.connect(scroll_to_left_animate); scroll_to_right_timer = new AnimateTimer(AnimateTimer.ease_out_quint, scroll_to_right_interval); - scroll_to_right_timer.animate.connect(scroll_to_right_animate); - + scroll_to_right_timer.animate.connect(scroll_to_right_animate); + // NOTE: don's set policy of scrolledwindow to NEVER. // Otherwise scrolledwindow will increate width with child's size. scrolledwindow = new ScrolledWindow(null, null); @@ -57,74 +57,74 @@ scrolledwindow.get_style_context().add_class("scrolledwindow"); scrolledwindow.get_vscrollbar().get_style_context().add_class("switcher_scrollbar"); scrolledwindow.get_hscrollbar().get_style_context().add_class("switcher_scrollbar"); - + box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); left_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); right_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); - + set_size_request(width, -1); - + box.pack_start(left_box, false, false, 0); box.pack_start(right_box, false, false, 0); scrolledwindow.add(box); pack_start(scrolledwindow, true, true, 0); } - + public void add_to_left_box(Gtk.Widget start_widget) { Utils.remove_all_children(left_box); Utils.remove_all_children(right_box); - + left_box.pack_start(start_widget, true, true, 0); } - + public void scroll_to_left(Gtk.Widget start_widget, Gtk.Widget end_widget) { Utils.remove_all_children(left_box); Utils.remove_all_children(right_box); - + left_box.pack_start(end_widget, true, true, 0); right_box.pack_start(start_widget, true, true, 0); - + var adjust = scrolledwindow.get_hadjustment(); adjust.set_value(width); - + scroll_to_left_start_x = width; scroll_to_left_end_x = 0; scroll_to_left_timer.reset(); } - + public void scroll_to_right(Gtk.Widget start_widget, Gtk.Widget end_widget) { Utils.remove_all_children(left_box); Utils.remove_all_children(right_box); - + left_box.pack_start(start_widget, true, true, 0); right_box.pack_start(end_widget, true, true, 0); var adjust = scrolledwindow.get_hadjustment(); adjust.set_value(0); - + scroll_to_right_start_x = 0; scroll_to_right_end_x = width; scroll_to_right_timer.reset(); } - - public void scroll_to_left_animate(double progress) { - var adjust = scrolledwindow.get_hadjustment(); - adjust.set_value(scroll_to_left_start_x + (int) (scroll_to_left_end_x - scroll_to_left_start_x) * progress); - + + public void scroll_to_left_animate(double progress) { + var adjust = scrolledwindow.get_hadjustment(); + adjust.set_value(scroll_to_left_start_x + (int) (scroll_to_left_end_x - scroll_to_left_start_x) * progress); + if (progress >= 1.0) { - scroll_to_left_timer.stop(); - } - } - - public void scroll_to_right_animate(double progress) { - var adjust = scrolledwindow.get_hadjustment(); - adjust.set_value(scroll_to_right_start_x + (int) (scroll_to_right_end_x - scroll_to_right_start_x) * progress); - + scroll_to_left_timer.stop(); + } + } + + public void scroll_to_right_animate(double progress) { + var adjust = scrolledwindow.get_hadjustment(); + adjust.set_value(scroll_to_right_start_x + (int) (scroll_to_right_end_x - scroll_to_right_start_x) * progress); + if (progress >= 1.0) { - scroll_to_right_timer.stop(); - } - } + scroll_to_right_timer.stop(); + } + } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/tabbar.vala deepin-terminal-3.0.7/widget/tabbar.vala --- deepin-terminal-3.0.3+ds/widget/tabbar.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/tabbar.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Cairo; using Draw; @@ -31,9 +31,9 @@ namespace Widgets { public class Tabbar : Gtk.DrawingArea { - public Gdk.RGBA tab_split_dark_color; - public Gdk.RGBA tab_split_light_color; - public HashMap tab_highlight_map; + public Gdk.RGBA tab_split_dark_color; + public Gdk.RGBA tab_split_light_color; + public HashMap tab_highlight_map; private Cairo.ImageSurface add_hover_dark_surface; private Cairo.ImageSurface add_hover_light_surface; private Cairo.ImageSurface add_normal_dark_surface; @@ -72,15 +72,15 @@ public int hover_clip_right_offset = 6; public int min_tab_width = 70; public int tab_index = 0; - - public signal void press_tab(int tab_index, int tab_id); - public signal void update_tab_underline(int x, int width); + + public signal void press_tab(int tab_index, int tab_id); + public signal void update_tab_underline(int x, int width); public signal void close_tab(int tab_index, int tab_id); public signal void new_tab(); - + public Tabbar() { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); - + add_events (Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK | Gdk.EventMask.POINTER_MOTION_MASK @@ -88,13 +88,13 @@ tab_list = new ArrayList(); tab_name_map = new HashMap(); - tab_highlight_map = new HashMap(); - + tab_highlight_map = new HashMap(); + font_description = new Pango.FontDescription(); font_description.set_size((int)(font_size * Pango.SCALE)); - + set_size_request(-1, height); - + close_normal_surface = Utils.create_image_surface("tab_close_normal.svg"); close_hover_surface = Utils.create_image_surface("tab_close_hover.svg"); close_press_surface = Utils.create_image_surface("tab_close_press.svg"); @@ -105,7 +105,7 @@ add_normal_light_surface = Utils.create_image_surface("tab_add_light_normal.svg"); add_hover_light_surface = Utils.create_image_surface("tab_add_light_hover.svg"); add_press_light_surface = Utils.create_image_surface("tab_add_light_press.svg"); - + inactive_arrow_color = Utils.hex_to_rgba("#393937"); hover_arrow_color = Utils.hex_to_rgba("#494943"); text_hover_dark_color = Utils.hex_to_rgba("#ffffff"); @@ -113,31 +113,31 @@ text_dark_color = Utils.hex_to_rgba("#ffffff", 0.8); text_light_color = Utils.hex_to_rgba("#000000", 0.8); text_highlight_color = Utils.hex_to_rgba("#ff9600"); - tab_split_dark_color = Utils.hex_to_rgba("#ffffff", 0.05); - tab_split_light_color = Utils.hex_to_rgba("#000000", 0.05); - text_active_color = Gdk.RGBA(); + tab_split_dark_color = Utils.hex_to_rgba("#ffffff", 0.05); + tab_split_light_color = Utils.hex_to_rgba("#000000", 0.05); + text_active_color = Gdk.RGBA(); tab_text_color = Gdk.RGBA(); - - draw.connect(on_draw); + + draw.connect(on_draw); configure_event.connect(on_configure); button_press_event.connect(on_button_press); button_release_event.connect(on_button_release); motion_notify_event.connect(on_motion_notify); leave_notify_event.connect(on_leave_notify); } - + public void init(WorkspaceManager workspace_manager, Widgets.ConfigWindow window) { press_tab.connect((t, tab_index, tab_id) => { - unhighlight_tab(tab_id); - workspace_manager.switch_workspace(tab_id); + unhighlight_tab(tab_id); + workspace_manager.switch_workspace(tab_id); }); - + close_tab.connect((t, tab_index, tab_id) => { Widgets.Workspace focus_workspace = workspace_manager.workspace_map.get(tab_id); if (focus_workspace.has_active_term()) { ConfirmDialog dialog; dialog = Widgets.create_running_confirm_dialog(window); - + dialog.confirm.connect((d) => { destroy_tab(tab_index); workspace_manager.remove_workspace(tab_id); @@ -147,7 +147,7 @@ workspace_manager.remove_workspace(tab_id); } }); - + new_tab.connect((t) => { workspace_manager.new_workspace_with_current_directory(); }); @@ -158,43 +158,43 @@ tab_name_map = new HashMap(); tab_index = 0; } - + public void add_tab(string tab_name, int tab_id) { tab_list.add(tab_id); tab_name_map.set(tab_id, tab_name); - + update_tab_scale(); - + queue_draw(); } - + public void rename_tab(int tab_id, string tab_name) { tab_name_map.set(tab_id, tab_name); - + if (is_focus_tab(tab_id)) { update_window_title(tab_name); } - + update_tab_scale(); - + queue_draw(); } - - public void highlight_tab(int tab_id) { - if (!tab_highlight_map.has_key(tab_id)) { - tab_highlight_map.set(tab_id, true); - - queue_draw(); - } - } - - public void unhighlight_tab(int tab_id) { - if (tab_highlight_map.has_key(tab_id)) { - tab_highlight_map.unset(tab_id); - - queue_draw(); - } - } + + public void highlight_tab(int tab_id) { + if (!tab_highlight_map.has_key(tab_id)) { + tab_highlight_map.set(tab_id, true); + + queue_draw(); + } + } + + public void unhighlight_tab(int tab_id) { + if (tab_highlight_map.has_key(tab_id)) { + tab_highlight_map.unset(tab_id); + + queue_draw(); + } + } public bool is_focus_tab(int tab_id) { int? index = tab_list.index_of(tab_id); @@ -204,7 +204,7 @@ return false; } } - + public void select_next_tab() { var index = tab_index + 1; if (index >= tab_list.size) { @@ -212,7 +212,7 @@ } switch_tab(index); } - + public void select_previous_tab() { var index = tab_index - 1; if (index < 0) { @@ -220,11 +220,11 @@ } switch_tab(index); } - + public void select_first_tab() { switch_tab(0); } - + public void select_end_tab() { var index = 0; if (tab_list.size == 0) { @@ -234,11 +234,11 @@ } switch_tab(index); } - + public void select_nth_tab(int index) { switch_tab(index); } - + public void select_tab_with_id(int tab_id) { switch_tab(tab_list.index_of(tab_id)); } @@ -246,17 +246,17 @@ public void close_current_tab() { close_nth_tab(tab_index); } - + public void close_nth_tab(int index) { if (tab_list.size > 0) { var tab_id = tab_list.get(index); close_tab(index, tab_id); } } - + public void destroy_tab(int index) { var tab_id = tab_list.get(index); - + tab_list.remove_at(index); tab_name_map.unset(tab_id); @@ -265,41 +265,41 @@ } else if (tab_index >= tab_list.size) { tab_index = tab_list.size - 1; } - + update_tab_scale(); - + queue_draw(); } - + public bool on_configure(Gtk.Widget widget, Gdk.EventConfigure event) { update_tab_scale(); - + queue_draw(); - + return false; } - + public bool on_button_press(Gtk.Widget widget, Gdk.EventButton event) { is_button_press = true; - + event.device.get_position(null, out button_press_x, out button_press_y); - + return false; } public bool on_button_release(Gtk.Widget widget, Gdk.EventButton event) { is_button_press = false; - + if (is_left_button(event)) { int button_release_x, button_release_y; event.device.get_position(null, out button_release_x, out button_release_y); - + if (button_release_x == button_press_x && button_release_y == button_press_y) { var release_x = (int)event.x; - + Gtk.Allocation alloc; widget.get_allocation(out alloc); - + int draw_x = 0; int counter = 0; foreach (int tab_id in tab_list) { @@ -310,7 +310,7 @@ if (release_x > draw_x && release_x < draw_x + tab_width) { if (release_x > draw_x && release_x < draw_x + tab_width - get_tab_close_button_padding()) { select_nth_tab(counter); - + press_tab(counter, tab_id); return false; } else if (release_x > draw_x + tab_width - get_tab_close_button_padding()) { @@ -318,27 +318,27 @@ return false; } } - + draw_x += tab_width; - + counter++; } - + if (release_x > draw_x && release_x < draw_x + add_button_width) { new_tab(); } - + queue_draw(); } } - + return false; } - + public int is_at_tab_close_button(int x) { Gtk.Allocation alloc; this.get_allocation(out alloc); - + int draw_x = 0; int counter = 0; foreach (int tab_id in tab_list) { @@ -350,84 +350,84 @@ if (x > draw_x + tab_width - get_tab_close_button_padding()) { return counter; } - } - + } + draw_x += tab_width; - + counter++; } - + return -1; } - + public bool on_motion_notify(Gtk.Widget widget, Gdk.EventMotion event) { draw_hover = true; hover_x = (int) event.x; - + queue_draw(); - + return false; } - + public bool on_leave_notify(Gtk.Widget widget, Gdk.EventCrossing event) { draw_hover = false; hover_x = 0; - + queue_draw(); - + return false; } - + public void update_tab_scale() { Gtk.Allocation alloc; this.get_allocation(out alloc); - + int tab_width = 0; foreach (int tab_id in tab_list) { int name_width, name_height; get_text_size(tab_name_map.get(tab_id), out name_width, out name_height); - + tab_width += get_tab_render_width(name_width); } - + if (tab_width + add_button_width > alloc.width) { - // FIXEME: I know 0.97 is magic number, this number avoid add_button render out of area of tabbar. + // FIXME: I know 0.97 is magic number, this number avoid add_button render out of area of tabbar. // Welcome to fix this. draw_scale = (double) alloc.width / (tab_width + add_button_width) * 0.97; } else { draw_scale = 1.0; } } - + public bool on_draw(Gtk.Widget widget, Cairo.Context cr) { Gtk.Allocation alloc; widget.get_allocation(out alloc); - + bool is_light_theme = ((Widgets.ConfigWindow) get_toplevel()).is_light_theme(); - + // Draw tab splitter. int draw_x = 0; int counter = 0; foreach (int tab_id in tab_list) { int name_width, name_height; get_text_size(tab_name_map.get(tab_id), out name_width, out name_height); - + int tab_width = get_tab_width(name_width); - + if (is_light_theme) { Utils.set_context_color(cr, tab_split_light_color); } else { Utils.set_context_color(cr, tab_split_dark_color); } - if (counter < tab_list.size) { - Draw.draw_rectangle(cr, draw_x, 0, tab_split_width, height); - } - + if (counter < tab_list.size) { + Draw.draw_rectangle(cr, draw_x, 0, tab_split_width, height); + } + draw_x += tab_width; - + counter++; } - + draw_x = 0; counter = 0; try { @@ -435,58 +435,58 @@ } catch (Error e) { print("Tabbar draw: %s\n", e.message); } - + int max_tab_width = 0; int max_tab_height = 0; foreach (int tab_id in tab_list) { int name_width, name_height; var layout = get_text_size(tab_name_map.get(tab_id), out name_width, out name_height); - + int tab_width = get_tab_width(name_width); - + max_tab_height = int.max(max_tab_height, name_height); - + if (tab_highlight_map.has_key(tab_id)) { - tab_text_color = text_highlight_color; - } else { + tab_text_color = text_highlight_color; + } else { if (is_light_theme) { - tab_text_color = text_light_color; + tab_text_color = text_light_color; } else { tab_text_color = text_dark_color; } - } - - if (counter == tab_index) { + } + + if (counter == tab_index) { cr.save(); clip_rectangle(cr, draw_x, 0, tab_width, height); - - update_tab_underline(draw_x, tab_width + 1); - + + update_tab_underline(draw_x, tab_width + 1); + cr.restore(); - + tab_text_color = text_active_color; } else { var is_hover = false; - + if (draw_hover) { if (hover_x > draw_x && hover_x < draw_x + tab_width) { is_hover = true; } } - + if (is_hover) { cr.save(); clip_rectangle(cr, draw_x, 0, tab_width + 1, height); - + if (is_light_theme) { Utils.set_context_color(cr, tab_split_light_color); } else { Utils.set_context_color(cr, tab_split_dark_color); } - Draw.draw_rectangle(cr, draw_x, 0, tab_width + 1, height); - + Draw.draw_rectangle(cr, draw_x, 0, tab_width + 1, height); + cr.restore(); - + if (is_light_theme) { tab_text_color = text_hover_light_color; } else { @@ -497,7 +497,7 @@ Draw.draw_rectangle(cr, draw_x, 0, tab_width, height); } } - + if (draw_hover) { if (hover_x > draw_x && hover_x < draw_x + tab_width) { if (hover_x > draw_x + tab_width - get_tab_close_button_padding()) { @@ -511,11 +511,11 @@ } } } - + // Draw tab text. cr.save(); clip_rectangle(cr, draw_x + get_tab_text_padding(), 0, tab_width - get_tab_text_padding() * 2, height); - + Utils.set_context_color(cr, tab_text_color); var is_hover = false; if (draw_hover) { @@ -523,7 +523,7 @@ is_hover = true; } } - + int text_render_y = (alloc.height - max_tab_height) / 2; if (is_hover) { cr.rectangle(draw_x, text_render_y, tab_width - get_tab_close_button_padding() - hover_clip_right_offset, height); @@ -531,17 +531,17 @@ } Draw.draw_layout(cr, layout, draw_x + get_tab_text_padding(), text_render_y); cr.restore(); - + draw_x += tab_width; - + max_tab_width = int.max(max_tab_width, tab_width); - + counter++; } - + // Don't allowed add tab when scale too small. allowed_add_tab = max_tab_width > min_tab_width || draw_scale >= 1.0; - + if (hover_x > draw_x && hover_x < draw_x + add_button_width) { if (is_button_press) { if (is_light_theme) { @@ -563,44 +563,44 @@ Draw.draw_surface(cr, add_normal_dark_surface, draw_x, 0, 0, height); } } - + return true; } public int get_tab_render_width(int name_width) { return int.max(name_width + get_tab_text_padding() * 2, tab_min_width); } - + public int get_tab_width(int name_width) { return int.max((int) ((name_width + get_tab_text_padding() * 2) * draw_scale), (int) (tab_min_width * draw_scale)); } - + public int get_tab_text_padding() { return text_padding_x; } - + public int get_tab_close_button_padding() { return close_button_padding_x; } - + public void switch_tab(int new_index) { tab_index = new_index; - + press_tab(tab_index, tab_list.get(tab_index)); - + queue_draw(); } - + public Pango.Layout get_text_size(string text, out int width, out int height) { var layout = create_pango_layout(text); layout.set_font_description(font_description); layout.get_pixel_size(out width, out height); - + return layout; } - + public void update_window_title(string title) { ((Gtk.Window) get_toplevel()).set_title("%s - %s".printf(title, _("Deepin Terminal"))); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/terminal.vala deepin-terminal-3.0.7/widget/terminal.vala --- deepin-terminal-3.0.3+ds/widget/terminal.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/terminal.vala 2018-10-06 18:03:56.000000000 +0000 @@ -84,8 +84,8 @@ "(?:callto:|h323:|sip:)" + USERCHARS_CLASS + "[" + USERCHARS + ".]*(?:" + PORT + "/[a-z0-9]+)?\\@" + HOST, "(?:mailto:)?" + USERCHARS_CLASS + "[" + USERCHARS + ".]*\\@" + HOSTCHARS_CLASS + "+\\." + HOST, "(?:news:|man:|info:)[[:alnum:]\\Q^_{|}~!\"#$%&'()*+,./;:=?`\\E]+", - "git\\@" + HOST + ":" + HOST + URLPATH, - }; + "git\\@" + HOST + ":" + HOST + URLPATH, + }; public KeyFile search_engine_config_file; public string search_engine_config_file_path = Utils.get_config_file_path("search-engine-config.conf"); @@ -115,18 +115,21 @@ } else { child_has_exit = true; - Widgets.ConfigWindow window = (Widgets.ConfigWindow) term.get_toplevel(); + // Since vte@0276859 (v0.53.92), the vte terminal always emit the `child-exited` signal + if (term.get_toplevel().get_type().is_a(typeof(ConfigWindow))) { + ConfigWindow window = (ConfigWindow) term.get_toplevel(); - try { - if (window.config.config_file.get_boolean("advanced", "print_notify_after_script_finish") && is_launch_command() && workspace_manager.is_first_term(this)) { - // Print exit notify if command execute finish. - print_exit_notify(); - } else { - // Just exit terminal if `child_exited' signal emit by shell. - exit(); + try { + if (window.config.config_file.get_boolean("advanced", "print_notify_after_script_finish") && is_launch_command() && workspace_manager.is_first_term(this)) { + // Print exit notify if command execute finish. + print_exit_notify(); + } else { + // Just exit terminal if `child_exited' signal emit by shell. + exit(); + } + } catch (Error e) { + print("child_exited: %s\n", e.message); } - } catch (Error e) { - print("child_exited: %s\n", e.message); } } }); @@ -363,12 +366,12 @@ display_first_spliter = true; } if (current_dir != "") { - var dir_file = GLib.File.new_for_path(current_dir); - if (dir_file.query_exists()) { - menu_content.append(new Menu.MenuItem("open_in_filemanager", _("Open in file manager"))); - } - - display_first_spliter = true; + var dir_file = GLib.File.new_for_path(current_dir); + if (dir_file.query_exists()) { + menu_content.append(new Menu.MenuItem("open_in_filemanager", _("Open in file manager"))); + } + + display_first_spliter = true; } if (display_first_spliter) { @@ -476,9 +479,9 @@ case "open": open_selection_file(); break; - case "open_in_filemanager": - open_current_dir_in_file_manager(); - break; + case "open_in_filemanager": + open_current_dir_in_file_manager(); + break; case "fullscreen": var window = ((Widgets.Window) get_toplevel()); window.toggle_fullscreen(); @@ -588,7 +591,7 @@ } upload_command = upload_command + "\n"; - this.term.feed_child(upload_command, upload_command.length); + this.term.feed_child(upload_command.to_utf8()); return false; }); @@ -615,7 +618,7 @@ GLib.Timeout.add(100, () => { // NOTE: Use quote around $file to avoid escape filepath. string command = "read -e -a files -p \"%s: \"; sz \"${files[@]}\"\n".printf(_("Type path for download file")); - this.term.feed_child(command, command.length); + this.term.feed_child(command.to_utf8()); enter_sz_command = true; @@ -660,17 +663,17 @@ GLib.Timeout.add(100, () => { // Switch directory in zssh. string switch_command = "cd %s\n".printf(save_file_directory); - this.term.feed_child(switch_command, switch_command.length); + this.term.feed_child(switch_command.to_utf8()); // Do rz command to download file. GLib.Timeout.add(100, () => { string download_command = "rz\n"; - this.term.feed_child(download_command, download_command.length); + this.term.feed_child(download_command.to_utf8()); // Press enter automatically. GLib.Timeout.add(100, () => { string enter_command = "\n"; - this.term.feed_child(enter_command, enter_command.length); + this.term.feed_child(enter_command.to_utf8()); return false; }); @@ -968,7 +971,7 @@ foreach (unowned string option in command_config_file.get_groups ()) { if (keyname == command_config_file.get_value(option, "Shortcut")) { var command_string = "%s\n".printf(command_config_file.get_value(option, "Command")); - term.feed_child(command_string, command_string.length); + term.feed_child(command_string.to_utf8()); return true; } @@ -1079,7 +1082,7 @@ } upload_command = upload_command + "\n"; - this.term.feed_child(upload_command, upload_command.length); + this.term.feed_child(upload_command.to_utf8()); return false; }); @@ -1094,7 +1097,7 @@ } string uris_s = string.joinv("", uris); - this.term.feed_child(uris_s, uris_s.length); + this.term.feed_child(uris_s.to_utf8()); } break; @@ -1103,7 +1106,7 @@ var data = selection_data.get_text (); if (data != null) { - this.term.feed_child(data, data.length); + this.term.feed_child(data.to_utf8()); } break; @@ -1154,7 +1157,7 @@ } } - // Init spawn/pty/argv arugment with option 'run_as_login_shell'. + // Init spawn/pty/argv argument with option 'run_as_login_shell'. PtyFlags pty_flags = PtyFlags.DEFAULT; GLib.SpawnFlags spawn_flags = 0; @@ -1269,7 +1272,7 @@ int pty_fd = this.term.get_pty().fd; int fgpid = Posix.tcgetpgrp(pty_fd); - if (fgpid != this.child_pid && fgpid != -1) { + if (fgpid != this.child_pid && fgpid > 0) { pid = (int) fgpid; return true; } else { @@ -1429,14 +1432,14 @@ } public void open_current_dir_in_file_manager() { - try { - GLib.AppInfo appinfo = GLib.AppInfo.create_from_commandline("xdg-open '%s'".printf(current_dir), null, GLib.AppInfoCreateFlags.NONE); - appinfo.launch(null, null); - } catch (GLib.Error e) { - print("Terminal open_current_dir_in_file_manager: %s\n", e.message); - } - } - + try { + GLib.AppInfo appinfo = GLib.AppInfo.create_from_commandline("xdg-open '%s'".printf(current_dir), null, GLib.AppInfoCreateFlags.NONE); + appinfo.launch(null, null); + } catch (GLib.Error e) { + print("Terminal open_current_dir_in_file_manager: %s\n", e.message); + } + } + public void login_server(string info) { // Record server info. server_info = info; @@ -1568,7 +1571,7 @@ if (term != null) { string login_command = "expect -f " + tmpfile.get_path() + "\n"; expect_file_path = tmpfile.get_path(); - term.feed_child(login_command, login_command.length); + term.feed_child(login_command.to_utf8()); } } catch (Error e) { stderr.printf("login_server: %s\n", e.message); diff -Nru deepin-terminal-3.0.3+ds/widget/text_button.vala deepin-terminal-3.0.7/widget/text_button.vala --- deepin-terminal-3.0.3+ds/widget/text_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/text_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,76 +19,76 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; namespace Widgets { public class TextButton : Widgets.ClickEventBox { - public bool is_hover = false; + public bool is_hover = false; public Gdk.RGBA text_hover_color; public Gdk.RGBA text_normal_color; public Gdk.RGBA text_press_color; public int button_text_size = 10; public int height = 30; public string button_text; - + public TextButton(string text, string normal_color_string, string hover_color_string, string press_color_string) { set_size_request(-1, height); - + button_text = text; - + text_normal_color = Utils.hex_to_rgba(normal_color_string); text_hover_color = Utils.hex_to_rgba(hover_color_string); text_press_color = Utils.hex_to_rgba(press_color_string); - + add_events(Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK | Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.LEAVE_NOTIFY_MASK); visible_window = false; - + enter_notify_event.connect((w, e) => { var display = Gdk.Display.get_default(); get_window().set_cursor(new Gdk.Cursor.for_display(display, Gdk.CursorType.HAND1)); - - is_hover = true; - queue_draw(); - + + is_hover = true; + queue_draw(); + return false; }); leave_notify_event.connect((w, e) => { get_window().set_cursor(null); - - is_hover = false; - queue_draw(); - + + is_hover = false; + queue_draw(); + return false; }); - + button_press_event.connect((w, e) => { queue_draw(); - + return false; }); button_release_event.connect((w, e) => { is_hover = false; queue_draw(); - + return false; }); clicked.connect((w, e) => { get_window().set_cursor(null); }); - + draw.connect(on_draw); } public bool on_draw(Gtk.Widget widget, Cairo.Context cr) { Gtk.Allocation rect; widget.get_allocation(out rect); - + if (is_hover) { if (is_press) { Utils.set_context_color(cr, text_press_color); @@ -101,8 +101,8 @@ Utils.set_context_color(cr, text_normal_color); Draw.draw_text(cr, button_text, 0, 0, rect.width, rect.height, button_text_size, Pango.Alignment.CENTER); } - - return true; + + return true; } } @@ -113,4 +113,4 @@ public TextButton create_delete_button(string text) { return new TextButton(text, "#FF5A5A", "#FF142D", "#AF0000"); } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/theme_button.vala deepin-terminal-3.0.7/widget/theme_button.vala --- deepin-terminal-3.0.3+ds/widget/theme_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/theme_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -92,17 +92,17 @@ Gtk.Allocation rect; widget.get_allocation(out rect); - cr.save(); - // Clip round rectangle when DPI > 1, for perfect radius effect. - if (get_scale_factor() > 1) { - Draw.clip_rounded_rectangle( - cr, - background_padding, - background_padding, - rect.width - background_padding * 2, - rect.height - background_padding * 2, - button_radius / get_scale_factor() + 1); - } + cr.save(); + // Clip round rectangle when DPI > 1, for perfect radius effect. + if (get_scale_factor() > 1) { + Draw.clip_rounded_rectangle( + cr, + background_padding, + background_padding, + rect.width - background_padding * 2, + rect.height - background_padding * 2, + button_radius / get_scale_factor() + 1); + } cr.set_source_rgba(background_color.red, background_color.green, background_color.blue, background_color.alpha); Draw.fill_rounded_rectangle( cr, @@ -111,9 +111,9 @@ rect.width - background_padding * 2, rect.height - background_padding * 2, button_radius / get_scale_factor()); - cr.restore(); + cr.restore(); - cr.set_source_rgba(foreground_color.red, foreground_color.green, foreground_color.blue, foreground_color.alpha); + cr.set_source_rgba(foreground_color.red, foreground_color.green, foreground_color.blue, foreground_color.alpha); Draw.draw_text(cr, "deepin@linux > _", title_padding_x, title_padding_y, rect.width, rect.height, title_font_size, Pango.Alignment.LEFT, "top"); cr.set_source_rgba(content_color.red, content_color.green, content_color.blue, content_color.alpha); diff -Nru deepin-terminal-3.0.3+ds/widget/theme_panel.vala deepin-terminal-3.0.7/widget/theme_panel.vala --- deepin-terminal-3.0.3+ds/widget/theme_panel.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/theme_panel.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gee; using Gtk; @@ -27,10 +27,10 @@ using Widgets; namespace Widgets { - public class ThemePanel : Gtk.HBox { - public Widgets.ConfigWindow parent_window; + public class ThemePanel : Gtk.HBox { + public Widgets.ConfigWindow parent_window; public Widgets.Switcher switcher; - public WorkspaceManager workspace_manager; + public WorkspaceManager workspace_manager; public Workspace workspace; public Gdk.RGBA background_color; public Gdk.RGBA line_dark_color; @@ -46,43 +46,43 @@ public int theme_list_margin_bottom = 5; public int theme_list_margin_top = 5; public int width = Constant.THEME_SLIDER_WIDTH; - + public delegate void UpdatePageAfterEdit(); - - public ThemePanel(Workspace space, WorkspaceManager manager) { + + public ThemePanel(Workspace space, WorkspaceManager manager) { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); - + workspace = space; - workspace_manager = manager; - + workspace_manager = manager; + config_file = new KeyFile(); - + line_dark_color = Utils.hex_to_rgba("#ffffff", 0.1); line_light_color = Utils.hex_to_rgba("#000000", 0.1); - + focus_widget = ((Gtk.Window) workspace.get_toplevel()).get_focus(); - parent_window = (Widgets.ConfigWindow) workspace.get_toplevel(); - + parent_window = (Widgets.ConfigWindow) workspace.get_toplevel(); + switcher = new Widgets.Switcher(width); - + home_page_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); set_size_request(width, -1); home_page_box.set_size_request(width, -1); - + pack_start(switcher, true, true, 0); - + show_home_page(); - - draw.connect(on_draw); + + draw.connect(on_draw); } - + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { bool is_light_theme = ((Widgets.ConfigWindow) get_toplevel()).is_light_theme(); - + Gtk.Allocation rect; widget.get_allocation(out rect); - + try { background_color = Utils.hex_to_rgba(parent_window.config.config_file.get_string("theme", "background")); } catch (Error e) { @@ -90,18 +90,18 @@ } cr.set_source_rgba(background_color.red, background_color.green, background_color.blue, 0.8); Draw.draw_rectangle(cr, 1, 0, rect.width - 1, rect.height); - + if (is_light_theme) { Utils.set_context_color(cr, line_light_color); } else { Utils.set_context_color(cr, line_dark_color); } Draw.draw_rectangle(cr, 0, 0, 1, rect.height); - + return false; } - - public void show_home_page(Gtk.Widget? start_widget=null) { + + public void show_home_page(Gtk.Widget? start_widget=null) { try { scrolledwindow = new ScrolledWindow(null, null); scrolledwindow.get_style_context().add_class("scrolledwindow"); @@ -113,43 +113,43 @@ realize.connect((w) => { init_scrollbar(); }); - + var theme_name = parent_window.config.config_file.get_string("general", "theme"); var theme_list = new ThemeList(theme_name); theme_list.margin_top = theme_list_margin_top; theme_list.margin_bottom = theme_list_margin_bottom; theme_list.active_theme.connect((active_theme_name) => { parent_window.config.set_theme(active_theme_name); - + init_scrollbar(); queue_draw(); }); - + scrolledwindow.add(theme_list); - + switcher.add_to_left_box(home_page_box); show.connect((w) => { GLib.Timeout.add(100, () => { int widget_x, widget_y; theme_list.active_theme_button.translate_coordinates(theme_list, 0, 0, out widget_x, out widget_y); - + Gtk.Allocation rect; get_allocation(out rect); - + var adjust = scrolledwindow.get_vadjustment(); adjust.set_value(widget_y - (rect.height - Constant.THEME_BUTTON_HEIGHT) / 2); - + return false; }); }); - + show_all(); } catch (Error e) { print("ThemePanel show_home_page: %s\n", e.message); } - } + } public void init_scrollbar() { scrolledwindow.get_vscrollbar().get_style_context().remove_class("light_scrollbar"); @@ -162,4 +162,4 @@ } } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/titlebar.vala deepin-terminal-3.0.7/widget/titlebar.vala --- deepin-terminal-3.0.3+ds/widget/titlebar.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/titlebar.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -28,20 +28,20 @@ public class Titlebar : Gtk.Overlay { public Widgets.WindowEventArea event_area; public WindowButton close_button; - + public Titlebar() { close_button = Widgets.create_close_button(); - + Box box = new Box(Gtk.Orientation.HORIZONTAL, 0); box.pack_start(close_button, true, true, 0); - + event_area = new Widgets.WindowEventArea(this); event_area.margin_end = Constant.CLOSE_BUTTON_WIDTH; add(box); add_overlay(event_area); - + set_size_request(-1, Constant.TITLEBAR_HEIGHT); } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/window_button.vala deepin-terminal-3.0.7/widget/window_button.vala --- deepin-terminal-3.0.3+ds/widget/window_button.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/window_button.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Cairo; using Draw; @@ -34,13 +34,13 @@ public Cairo.ImageSurface normal_light_surface; public Cairo.ImageSurface press_dark_surface; public Cairo.ImageSurface press_light_surface; - public bool is_hover = false; + public bool is_hover = false; public bool is_theme_button; public int surface_y; - + public WindowButton(string image_path, bool theme_button=false, int width, int height) { is_theme_button = theme_button; - + if (is_theme_button) { normal_dark_surface = Utils.create_image_surface(image_path + "_dark_normal.svg"); hover_dark_surface = Utils.create_image_surface(image_path + "_dark_hover.svg"); @@ -54,37 +54,37 @@ hover_dark_surface = Utils.create_image_surface(image_path + "_hover.svg"); press_dark_surface = Utils.create_image_surface(image_path + "_press.svg"); } - + set_size_request(width, height); - + surface_y = (height - normal_dark_surface.get_height() / get_scale_factor()) / 2; - + draw.connect(on_draw); - enter_notify_event.connect((w, e) => { + enter_notify_event.connect((w, e) => { is_hover = true; - queue_draw(); - - return false; - }); - leave_notify_event.connect((w, e) => { - is_hover = false; - queue_draw(); - - return false; - }); - button_press_event.connect((w, e) => { - queue_draw(); - - return false; - }); - button_release_event.connect((w, e) => { + queue_draw(); + + return false; + }); + leave_notify_event.connect((w, e) => { is_hover = false; queue_draw(); - - return false; - }); + + return false; + }); + button_press_event.connect((w, e) => { + queue_draw(); + + return false; + }); + button_release_event.connect((w, e) => { + is_hover = false; + queue_draw(); + + return false; + }); } - + private bool on_draw(Gtk.Widget widget, Cairo.Context cr) { bool is_light_theme = false; var top_level = get_toplevel(); @@ -93,7 +93,7 @@ } else { is_light_theme = ((Widgets.ConfigWindow) get_toplevel()).is_light_theme(); } - + if (is_hover) { if (is_press) { if (is_theme_button && is_light_theme) { @@ -115,7 +115,7 @@ Draw.draw_surface(cr, normal_dark_surface, 0, surface_y); } } - + return true; } } @@ -123,7 +123,7 @@ public WindowButton create_close_button() { var close_button = new WindowButton("titlebar_close", false, Constant.WINDOW_BUTTON_WIDHT + Constant.CLOSE_BUTTON_MARGIN_RIGHT, Constant.TITLEBAR_HEIGHT); close_button.set_halign(Gtk.Align.END); - + return close_button; } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/window_event_area.vala deepin-terminal-3.0.7/widget/window_event_area.vala --- deepin-terminal-3.0.3+ds/widget/window_event_area.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/window_event_area.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gtk; using Widgets; @@ -35,41 +35,41 @@ public double press_x = 0; public double press_y = 0; public int double_clicked_max_delay = 150; - + public delegate bool FilterDoubleClick(int x, int y); - + public WindowEventArea(Gtk.Container area) { drawing_area = area; - + visible_window = false; - + add_events(Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK | Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.LEAVE_NOTIFY_MASK); - + leave_notify_event.connect((w, e) => { if (child_before_leave != null) { var e2 = e.copy(); e2.crossing.window = child_before_leave.get_window(); - + child_before_leave.get_window().ref(); ((Gdk.Event*) e2)->put(); - + child_before_leave = null; } - + return false; }); - + motion_notify_event.connect((w, e) => { var child = get_child_at_pos(drawing_area, (int) e.x, (int) e.y); child_before_leave = child; - + if (child != null) { int x, y; drawing_area.translate_coordinates(child, (int) e.x, (int) e.y, out x, out y); - + Gdk.EventMotion* event; event = (Gdk.EventMotion) new Gdk.Event(Gdk.EventType.MOTION_NOTIFY); event->window = child.get_window(); @@ -85,13 +85,13 @@ event->axes = e.axes; ((Gdk.Event*) event)->put(); } - + return true; }); - + button_press_event.connect((w, e) => { is_press = true; - + e.device.get_position(null, out press_x, out press_y); GLib.Timeout.add(10, () => { @@ -99,7 +99,7 @@ if (is_press) { int pointer_x, pointer_y; e.device.get_position(null, out pointer_x, out pointer_y); - + if (pointer_x != press_x || pointer_y != press_y) { pointer_x *= get_scale_factor(); pointer_y *= get_scale_factor(); @@ -112,13 +112,13 @@ return false; } }); - - + + var child = get_child_at_pos(drawing_area, (int) e.x, (int) e.y); if (child != null) { int x, y; drawing_area.translate_coordinates(child, (int) e.x, (int) e.y, out x, out y); - + Gdk.EventButton* event; event = (Gdk.EventButton) new Gdk.Event(Gdk.EventType.BUTTON_PRESS); event->window = child.get_window(); @@ -133,14 +133,14 @@ event->button = e.button; ((Gdk.Event*) event)->put(); } - + if (e.type == Gdk.EventType.BUTTON_PRESS) { is_double_clicked = true; - + // Add timeout to avoid long-long-long time double clicked to cause toggle maximize action. GLib.Timeout.add(double_clicked_max_delay, () => { is_double_clicked = false; - + return false; }); } else if (e.type == Gdk.EventType.2BUTTON_PRESS) { @@ -152,18 +152,18 @@ } } } - + return true; }); button_release_event.connect((w, e) => { is_press = false; - + var child = get_child_at_pos(drawing_area, (int) e.x, (int) e.y); if (child != null) { int x, y; drawing_area.translate_coordinates(child, (int) e.x, (int) e.y, out x, out y); - + Gdk.EventButton* event; event = (Gdk.EventButton) new Gdk.Event(Gdk.EventType.BUTTON_RELEASE); event->window = child.get_window(); @@ -178,11 +178,11 @@ event->button = e.button; ((Gdk.Event*) event)->put(); } - + return true; }); } - + public Gtk.Widget? get_child_at_pos(Gtk.Container container, int x, int y) { if (container.get_children().length() > 0) { foreach (Gtk.Widget child in container.get_children()) { @@ -191,7 +191,7 @@ int child_x, child_y; child.translate_coordinates(container, 0, 0, out child_x, out child_y); - + if (x >= child_x && x <= child_x + child_rect.width && y >= child_y && y <= child_y + child_rect.height) { if (child.get_type().is_a(typeof(Gtk.Container))) { return get_child_at_pos((Gtk.Container) child, x - child_x, y - child_y); diff -Nru deepin-terminal-3.0.3+ds/widget/window.vala deepin-terminal-3.0.7/widget/window.vala --- deepin-terminal-3.0.3+ds/widget/window.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/window.vala 2018-10-06 18:03:56.000000000 +0000 @@ -151,7 +151,7 @@ }); configure_event.connect((w) => { - // Update input shape. + // Update input shape. Cairo.RectangleInt rect; get_window().get_frame_extents(out rect); rect.x = 0; @@ -165,11 +165,11 @@ var shape = new Cairo.Region.rectangle(rect); get_window().input_shape_combine_region(shape, 0, 0); - - // Update blur area. - update_blur_status(); - - return false; + + // Update blur area. + update_blur_status(); + + return false; }); window_state_event.connect((w, e) => { @@ -226,8 +226,8 @@ config.update.connect((w) => { update_style(); - - update_blur_status(true); + + update_blur_status(true); }); } @@ -297,64 +297,64 @@ window_frame_box.get_style_context().remove_class("window_noradius_noshadow_inactive"); window_frame_box.get_style_context().remove_class("window_noradius_noshadow_active"); } - - public void update_blur_status(bool force_update=false) { - try { - int width, height; - get_size(out width, out height); - - if (width != resize_cache_width || height != resize_cache_height || force_update) { - resize_cache_width = width; - resize_cache_height = height; - - unowned X.Display xdisplay = (get_window().get_display() as Gdk.X11.Display).get_xdisplay(); - var xid = (int)((Gdk.X11.Window) get_window()).get_xid(); - var atom_NET_WM_DEEPIN_BLUR_REGION_ROUNDED = xdisplay.intern_atom("_NET_WM_DEEPIN_BLUR_REGION_ROUNDED", false); - - var blur_background = config.config_file.get_boolean("advanced", "blur_background"); - if (blur_background) { - Cairo.RectangleInt blur_rect; - get_window().get_frame_extents(out blur_rect); - blur_rect.x = 0; - blur_rect.y = 0; - - if (!window_is_fullscreen() && !window_is_max() && screen_monitor.is_composited()) { - blur_rect.x = window_frame_box.margin_start; - blur_rect.y = window_frame_box.margin_top; - blur_rect.width += - window_frame_box.margin_start - window_frame_box.margin_end; - blur_rect.height += - window_frame_box.margin_top - window_frame_box.margin_bottom; - } - - blur_rect.x = (int) (blur_rect.x * Utils.get_default_monitor_scale()); - blur_rect.y = (int) (blur_rect.y * Utils.get_default_monitor_scale()); - blur_rect.width = (int) (blur_rect.width * Utils.get_default_monitor_scale()); - blur_rect.height = (int) (blur_rect.height * Utils.get_default_monitor_scale()); - - ulong[] data = {(ulong) blur_rect.x, (ulong) blur_rect.y, (ulong) blur_rect.width, (ulong) blur_rect.height, 8, 8}; - xdisplay.change_property( - xid, - atom_NET_WM_DEEPIN_BLUR_REGION_ROUNDED, - X.XA_CARDINAL, - 32, - X.PropMode.Replace, - (uchar[])data, - ((ulong[]) data).length); - } else { - ulong[] data = {0, 0, 0, 0, 0, 0}; - xdisplay.change_property( - xid, - atom_NET_WM_DEEPIN_BLUR_REGION_ROUNDED, - X.XA_CARDINAL, - 32, - X.PropMode.Replace, - (uchar[])data, - ((ulong[]) data).length); - } - } - } catch (GLib.KeyFileError e) { - print("%s\n", e.message); - } - } + + public void update_blur_status(bool force_update=false) { + try { + int width, height; + get_size(out width, out height); + + if (width != resize_cache_width || height != resize_cache_height || force_update) { + resize_cache_width = width; + resize_cache_height = height; + + unowned X.Display xdisplay = (get_window().get_display() as Gdk.X11.Display).get_xdisplay(); + var xid = (int)((Gdk.X11.Window) get_window()).get_xid(); + var atom_NET_WM_DEEPIN_BLUR_REGION_ROUNDED = xdisplay.intern_atom("_NET_WM_DEEPIN_BLUR_REGION_ROUNDED", false); + + var blur_background = config.config_file.get_boolean("advanced", "blur_background"); + if (blur_background) { + Cairo.RectangleInt blur_rect; + get_window().get_frame_extents(out blur_rect); + blur_rect.x = 0; + blur_rect.y = 0; + + if (!window_is_fullscreen() && !window_is_max() && screen_monitor.is_composited()) { + blur_rect.x = window_frame_box.margin_start; + blur_rect.y = window_frame_box.margin_top; + blur_rect.width += - window_frame_box.margin_start - window_frame_box.margin_end; + blur_rect.height += - window_frame_box.margin_top - window_frame_box.margin_bottom; + } + + blur_rect.x = (int) (blur_rect.x * Utils.get_default_monitor_scale()); + blur_rect.y = (int) (blur_rect.y * Utils.get_default_monitor_scale()); + blur_rect.width = (int) (blur_rect.width * Utils.get_default_monitor_scale()); + blur_rect.height = (int) (blur_rect.height * Utils.get_default_monitor_scale()); + + ulong[] data = {(ulong) blur_rect.x, (ulong) blur_rect.y, (ulong) blur_rect.width, (ulong) blur_rect.height, 8, 8}; + xdisplay.change_property( + xid, + atom_NET_WM_DEEPIN_BLUR_REGION_ROUNDED, + X.XA_CARDINAL, + 32, + X.PropMode.Replace, + (uchar[])data, + ((ulong[]) data).length); + } else { + ulong[] data = {0, 0, 0, 0, 0, 0}; + xdisplay.change_property( + xid, + atom_NET_WM_DEEPIN_BLUR_REGION_ROUNDED, + X.XA_CARDINAL, + 32, + X.PropMode.Replace, + (uchar[])data, + ((ulong[]) data).length); + } + } + } catch (GLib.KeyFileError e) { + print("%s\n", e.message); + } + } public void draw_window_widgets(Cairo.Context cr) { Utils.propagate_draw(this, cr); @@ -393,7 +393,7 @@ public override void update_frame() { update_style(); - + if (!screen_monitor.is_composited() || window_is_fullscreen() || window_is_max()) { window_widget_box.margin_top = 0; window_widget_box.margin_bottom = 0; @@ -462,7 +462,7 @@ Draw.draw_rectangle(cr, x + 2, y + height - 2, width - 4, 1); // Left. Draw.draw_rectangle(cr, x + 1, y + Constant.TITLEBAR_HEIGHT + 2, 1, height - Constant.TITLEBAR_HEIGHT - 4); - // Rigt.. + // Right.. Draw.draw_rectangle(cr, x + width - 2, y + Constant.TITLEBAR_HEIGHT + 2, 1, height - Constant.TITLEBAR_HEIGHT - 4); cr.restore(); } else { @@ -498,21 +498,21 @@ try { if (window_is_fullscreen()) { - int titlebar_y = y; - if (get_scale_factor() > 1) { - titlebar_y -= 1; - } - + int titlebar_y = y; + if (get_scale_factor() > 1) { + titlebar_y -= 1; + } + if (draw_tabbar_line) { draw_titlebar_underline(cr, x, titlebar_y, width, 1); draw_active_tab_underline(cr, x + active_tab_underline_x - window_frame_box.margin_start, titlebar_y + Constant.TITLEBAR_HEIGHT); } } else if (window_is_max() || window_is_tiled()) { - int titlebar_y = y; - if (get_scale_factor() > 1) { - titlebar_y -= 1; - } - + int titlebar_y = y; + if (get_scale_factor() > 1) { + titlebar_y -= 1; + } + draw_titlebar_underline(cr, x + 1, titlebar_y, width - 2, 1); draw_active_tab_underline(cr, x + active_tab_underline_x - window_frame_box.margin_start, titlebar_y + Constant.TITLEBAR_HEIGHT + 1); } else { @@ -548,11 +548,11 @@ // Right. Draw.draw_rectangle(cr, x + width - 2, y + 2, 1, Constant.TITLEBAR_HEIGHT); - int titlebar_y = y; - if (get_scale_factor() > 1) { - titlebar_y += 1; - } - + int titlebar_y = y; + if (get_scale_factor() > 1) { + titlebar_y += 1; + } + draw_titlebar_underline(cr, x + 1, titlebar_y, width - 2, 1); draw_active_tab_underline(cr, x + active_tab_underline_x - window_frame_box.margin_start, titlebar_y + Constant.TITLEBAR_HEIGHT); } diff -Nru deepin-terminal-3.0.3+ds/widget/workspace_manager.vala deepin-terminal-3.0.7/widget/workspace_manager.vala --- deepin-terminal-3.0.3+ds/widget/workspace_manager.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/workspace_manager.vala 2018-10-06 18:03:56.000000000 +0000 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - */ + */ using Gee; using Gtk; @@ -33,20 +33,20 @@ public Tabbar tabbar; public Workspace focus_workspace; public int workspace_index; - + public WorkspaceManager(Tabbar t, string? work_directory) { Intl.bindtextdomain(GETTEXT_PACKAGE, "/usr/share/locale"); - + tabbar = t; workspace_index = 0; workspace_map = new HashMap(); - + has_first_term_created = false; - + new_workspace(work_directory); } - + public void set_first_term(Widgets.Term term) { // Set first terminal to make only first create tab terminal execute -e commands, // all terminals created by user's new_tab action won't execute -e commands. @@ -55,7 +55,7 @@ has_first_term_created = true; } } - + public bool is_first_term(Widgets.Term term) { if (first_term == null) { return true; @@ -63,25 +63,25 @@ return first_term == term; } } - + public void pack_workspace(Workspace workspace) { focus_workspace = workspace; pack_start(workspace, true, true, 0); - + workspace.select_focus_terminal(); } - - public void new_workspace_with_current_directory(bool remote_serve_action=false) { - Term focus_term = focus_workspace.get_focus_term(this); - new_workspace(focus_term.get_cwd(), remote_serve_action); - } - + + public void new_workspace_with_current_directory(bool remote_serve_action=false) { + Term focus_term = focus_workspace.get_focus_term(this); + new_workspace(focus_term.get_cwd(), remote_serve_action); + } + public void new_workspace(string? work_directory, bool remote_serve_action=false) { if (tabbar.allowed_add_tab || remote_serve_action) { Utils.remove_all_children(this); - + workspace_index++; - + tabbar.add_tab("", workspace_index); Widgets.Workspace workspace = new Widgets.Workspace(workspace_index, work_directory, this); workspace_map.set(workspace_index, workspace); @@ -94,11 +94,11 @@ workspace.exit.connect((workspace, index) => { tabbar.close_current_tab(); }); - + pack_workspace(workspace); - + tabbar.select_tab_with_id(workspace_index); - + show_all(); } else { var config_window = (Widgets.ConfigWindow) get_toplevel(); @@ -117,7 +117,7 @@ } } } - + public void switch_workspace_with_index(int index) { if (index == 1) { tabbar.select_first_tab(); @@ -127,20 +127,20 @@ tabbar.select_nth_tab(index - 1); } } - + public void switch_workspace(int workspace_index) { Utils.remove_all_children(this); - + var workspace = workspace_map.get(workspace_index); pack_workspace(workspace); - + show_all(); } - + public void remove_workspace(int index) { workspace_map.get(index).destroy(); workspace_map.unset(index); - + if (tabbar.tab_list.size == 0) { var config_window = (Widgets.ConfigWindow) get_toplevel(); config_window.quit(); @@ -150,19 +150,19 @@ var workspace = workspace_map.get(workspace_index); pack_workspace(workspace); - + show_all(); } } - + public bool has_active_term() { foreach (var workspace_entry in workspace_map.entries) { if (workspace_entry.value.has_active_term()) { return true; } } - + return false; } } -} \ No newline at end of file +} diff -Nru deepin-terminal-3.0.3+ds/widget/workspace.vala deepin-terminal-3.0.7/widget/workspace.vala --- deepin-terminal-3.0.3+ds/widget/workspace.vala 2018-08-19 11:50:46.000000000 +0000 +++ deepin-terminal-3.0.7/widget/workspace.vala 2018-10-06 18:03:56.000000000 +0000 @@ -95,7 +95,7 @@ } public Term new_term(bool first_term, string? work_directory) { - Term term = new Widgets.Term(first_term, work_directory, workspace_manager); + Term term = new Widgets.Term(first_term, work_directory, workspace_manager); term.change_title.connect((term, dir) => { change_title(index, dir); }); @@ -127,24 +127,24 @@ } public void reset_term(int exit_status) { - Term focus_term = get_focus_term(this); + Term focus_term = get_focus_term(this); string term_dir = focus_term.get_cwd(); - - split_vertical(); - close_term(focus_term); + + split_vertical(); + close_term(focus_term); GLib.Timeout.add(500, () => { - if (term_dir.length > 0) { - Term new_focus_term = get_focus_term(this); - string switch_command = "cd %s\n".printf(term_dir); - new_focus_term.term.feed_child(switch_command, switch_command.length); - } - - return false; - }); - - print("Reset terminal after got exit status: %i\n", exit_status); - } + if (term_dir.length > 0) { + Term new_focus_term = get_focus_term(this); + string switch_command = "cd %s\n".printf(term_dir); + new_focus_term.term.feed_child(switch_command.to_utf8()); + } + + return false; + }); + + print("Reset terminal after got exit status: %i\n", exit_status); + } public bool has_active_term() { foreach (Term term in term_list) { @@ -347,7 +347,7 @@ return true; }); - + Term term = new_term(false, focus_term.get_cwd()); paned.pack1(focus_term, true, false); paned.pack2(term, true, false);