diff -Nru sakura-3.8.3/CMakeLists.txt sakura-3.8.4/CMakeLists.txt --- sakura-3.8.3/CMakeLists.txt 2021-07-22 17:05:41.000000000 +0000 +++ sakura-3.8.4/CMakeLists.txt 2021-10-15 00:55:05.000000000 +0000 @@ -31,8 +31,8 @@ MESSAGE(FATAL_ERROR "You don't seem to have x11 development libraries installed...") ENDIF (NOT X11_FOUND) -FIND_PROGRAM(POD2MAN pod2man) -MESSAGE ("pod2man executable is" ${POD2MAN}) +FIND_PROGRAM(POD2MAN pod2man) +MESSAGE ("pod2man executable is" ${POD2MAN}) ADD_DEFINITIONS (-DVERSION="${VERSION}") ADD_DEFINITIONS (-DDATADIR="${CMAKE_INSTALL_PREFIX}/share") @@ -51,13 +51,13 @@ ADD_SUBDIRECTORY (po) -INSTALL (TARGETS sakura RUNTIME DESTINATION bin) +INSTALL (TARGETS sakura RUNTIME DESTINATION bin) INSTALL (FILES sakura.desktop DESTINATION share/applications) INSTALL (FILES terminal-tango.svg DESTINATION share/pixmaps) -IF (POD2MAN) - INSTALL (FILES ${sakura_BINARY_DIR}/sakura.1 DESTINATION share/man/man1) +IF (POD2MAN) + INSTALL (FILES ${sakura_BINARY_DIR}/sakura.1 DESTINATION share/man/man1) ENDIF (POD2MAN) -INSTALL (FILES README.md DESTINATION share/doc/sakura) +INSTALL (FILES README.md DESTINATION share/doc/sakura) FILE (GLOB MO_FILES po/*.mo) @@ -67,10 +67,10 @@ ADD_CUSTOM_TARGET (distclean rm -f Makefile cmake_install.cmake CMakeCache.txt install_manifest.txt sakura.1 - COMMAND rm -f po/*.mo po/sakura.pot po/Makefile po/cmake_install.cmake + COMMAND rm -f po/*.mo po/sakura.pot po/Makefile po/cmake_install.cmake COMMAND rm -rf CMakeFiles po/CMakeFiles) -IF (POD2MAN) +IF (POD2MAN) ADD_CUSTOM_TARGET(man ALL COMMAND ${POD2MAN} -u --section=1 --release=${VERSION} --center '' ${sakura_SOURCE_DIR}/sakura.pod sakura.1) -ENDIF (POD2MAN) +ENDIF (POD2MAN) diff -Nru sakura-3.8.3/debian/changelog sakura-3.8.4/debian/changelog --- sakura-3.8.3/debian/changelog 2021-08-16 20:58:55.000000000 +0000 +++ sakura-3.8.4/debian/changelog 2021-10-19 13:54:05.000000000 +0000 @@ -1,3 +1,12 @@ +sakura (3.8.4-1) unstable; urgency=medium + + * New upstream version 3.8.4 + * Update Standards Version to 4.6.0.1 (No changes required) + * Update Copyright source location + * Update copyright years + + -- Andreas Rönnquist Tue, 19 Oct 2021 15:54:05 +0200 + sakura (3.8.3-1) unstable; urgency=medium * New upstream version 3.8.3 diff -Nru sakura-3.8.3/debian/control sakura-3.8.4/debian/control --- sakura-3.8.3/debian/control 2021-08-16 20:57:40.000000000 +0000 +++ sakura-3.8.4/debian/control 2021-10-19 13:54:05.000000000 +0000 @@ -9,7 +9,7 @@ libpcre2-dev, libvte-2.91-dev, perl -Standards-Version: 4.5.1 +Standards-Version: 4.6.0.1 Rules-Requires-Root: no Vcs-Git: https://salsa.debian.org/debian/sakura.git Vcs-Browser: https://salsa.debian.org/debian/sakura diff -Nru sakura-3.8.3/debian/copyright sakura-3.8.4/debian/copyright --- sakura-3.8.3/debian/copyright 2021-08-16 19:58:24.000000000 +0000 +++ sakura-3.8.4/debian/copyright 2021-10-19 13:54:05.000000000 +0000 @@ -1,15 +1,15 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Sakura Upstream-Contact: David Gómez -Source: http://www.pleyades.net/david/sakura.php +Source: https://www.pleyades.net/david/projects/sakura Files: * -Copyright: 2006-2012, David Gómez +Copyright: 2006-2021, David Gómez 2008, Hong Jen Yee (PCMan) License: GPL-2 Files: debian/* -Copyright: 2008-2011, Andrew Starr-Bochicchio +Copyright: 2008-2021, Andrew Starr-Bochicchio 2015-2017, Andreas Rönnquist License: GPL-2 diff -Nru sakura-3.8.3/po/CMakeLists.txt sakura-3.8.4/po/CMakeLists.txt --- sakura-3.8.3/po/CMakeLists.txt 2021-07-22 17:05:41.000000000 +0000 +++ sakura-3.8.4/po/CMakeLists.txt 2021-10-15 00:55:05.000000000 +0000 @@ -17,14 +17,14 @@ ADD_CUSTOM_TARGET(translations ALL) ADD_CUSTOM_COMMAND(TARGET translations - COMMAND ${XGETTEXT} -o sakura.pot --keyword=_ --keyword=N_ --no-location --from-code=utf-8 ${SOURCES} + COMMAND ${XGETTEXT} -o sakura.pot --keyword=_ --keyword=N_ --no-location --from-code=utf-8 ${SOURCES} DEPENDS ${_poFile}) FOREACH(_poFile ${PO_FILES}) GET_FILENAME_COMPONENT(_lang ${_poFile} NAME_WE) SET(_moFile ${_lang}.mo) - ADD_CUSTOM_COMMAND(TARGET translations + ADD_CUSTOM_COMMAND(TARGET translations COMMAND ${MSGMERGE} -q -U ${_poFile} --backup=none sakura.pot - COMMAND ${MSGFMT} --check -o ${_moFile} ${_poFile} + COMMAND ${MSGFMT} --check -o ${_moFile} ${_poFile} DEPENDS ${_poFile}) INSTALL(FILES ${CMAKE_BINARY_DIR}/po/${_moFile} DESTINATION share/locale/${_lang}/LC_MESSAGES/ @@ -32,5 +32,3 @@ ENDFOREACH(_poFile ${PO_FILES}) ENDIF(NOT MSGFMT) - - diff -Nru sakura-3.8.3/README.md sakura-3.8.4/README.md --- sakura-3.8.3/README.md 2021-07-22 17:05:41.000000000 +0000 +++ sakura-3.8.4/README.md 2021-10-15 00:55:05.000000000 +0000 @@ -1,95 +1,95 @@ -# sakura - -**sakura** is a simple [gtk](http://www.gtk.org) and [vte](https://gitlab.gnome.org/GNOME/vte) based terminal emulator. It uses tabs to provide several terminals in one window and allows to change configuration options via a contextual menu. No more no less. - -## Installation - -How to compile and install this beast ? - -```bash -$ cmake . -$ make -$ sudo 'make install' -``` -**sakura** now uses the CMake building system (RIP our old system MOBS, we'll remember you ;)). - -To install **sakura** with a different prefix, cmake needs to be invoked with the proper environment -variables, so for example, to install sakura in `/usr`, you must type: - -```bash -$ cmake -DCMAKE_INSTALL_PREFIX=/usr . -``` - -Use CMAKE_BUILD_TYPE=Debug if you need debug symbols. Default type is "Release". - - -## Usage - -**sakura** has several command line options. Run `sakura --help` for a full list. - -## Keybindings - -**sakura** supports keyboard bindings in its config file (`~/.config/sakura/sakura.conf`), but there's no GUI to edit them, so please use your favourite editor to change the following values. Keybindings are a combination of an accelerator+key. - -### Accelerators - -Accelerators can be set to any _GdkModifierType_ mask value. The full list of _GdkModifierType_ values is available [here](http://gtk.php.net/manual/en/html/gdk/gdk.enum.modifiertype.html) - -Mask values can be combined by ORing them. For example, to set the delete tab accelerator to Ctrl+Shift, change the option "del_tab_accelerator" value to "5". This number comes from ORing GDK_SHIFT_MASK and GDK_CONTROL_MASK. - -I realise that this configuration is not user-friendly, but... :-P - -Quick reference: Shift(1), Cps-Lock(2), Ctrl(4), Alt(8), Ctrl-S(5), Ctrl-A(12), Ctrl-A-S(13) - -### Keys - -To change default keys, set the key value you want to modify to your desired key. For example, if you want to use the "D" key instead of the "W" key to delete a tab, set "del_tab_key" to "D" in the config file. - -### Default keybindings - - Ctrl + Shift + T -> New tab - Ctrl + Shift + W -> Close current tab - Ctrl + Shift + C -> Copy selected text - Ctrl + Shift + V -> Paste selected text - Ctrl + Shift + N -> Set tab name - - Ctr + Left cursor -> Previous tab - Ctr + Right cursor -> Next tab - Ctr + Shift + Left cursor -> Move tab to the left - Ctr + Shift + Right cursor -> Move tab to the right - Ctrl + [1-9] -> Switch to tab N (1-9) - - Ctrl + Shift + S -> Toggle/Untoggle scrollbar - Ctrl + Shift + Mouse left button -> Open link - F11 -> Fullscreen - Shift + PageUp -> Move up through scrollback by page - Shift + PageDown -> Move down through scrollback by page - Ctrl + Shift + Up -> Move up through scrollback by line - Ctrl + Shift + Down -> Move down through scrollback by line - Ctrl + Shift + [F1-F6] -> Select the colorset for the current tab - -You can also increase and decrease the font size in the GTK standard way: - - Ctrl + '+' -> Increase font size - Ctrl + '-' -> Decrease font size - -By default, mouse buttons are bound to the following: - - Button1 -> No action - Button2 -> Paste - Button3 -> Context menu - -Behavior can be changed with the following config settings: - - copy_on_select -> set to true to automatically copy selected text - paste_button -> set to desired mouse button (default: 2) - menu_button -> set to desired mouse button (default: 3) - -## Contributing -Pull requests are welcome. But please, create first a bug report in [Launchpad](https://bugs.launchpad.net/sakura), particularly if you plan to make major changes, to make sure your patch will be merged into **sakura**. If you'd like to contribute with translations, use the translations framework in [Launchpad](https://translations.launchpad.net/sakura) or send [me](mailto:dabisu@gmail.com) directly the translated po file. - -## License -[GPL 2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) - -\ -Enjoy **sakura**! \ No newline at end of file +# sakura + +**sakura** is a simple [gtk](http://www.gtk.org) and [vte](https://gitlab.gnome.org/GNOME/vte) based terminal emulator. It uses tabs to provide several terminals in one window and allows to change configuration options via a contextual menu. No more no less. + +## Installation + +How to compile and install this beast ? + +```bash +$ cmake . +$ make +$ sudo 'make install' +``` +**sakura** now uses the CMake building system (RIP our old system MOBS, we'll remember you ;)). + +To install **sakura** with a different prefix, cmake needs to be invoked with the proper environment +variables, so for example, to install sakura in `/usr`, you must type: + +```bash +$ cmake -DCMAKE_INSTALL_PREFIX=/usr . +``` + +Use CMAKE_BUILD_TYPE=Debug if you need debug symbols. Default type is "Release". + + +## Usage + +**sakura** has several command line options. Run `sakura --help` for a full list. + +## Keybindings + +**sakura** supports keyboard bindings in its config file (`~/.config/sakura/sakura.conf`), but there's no GUI to edit them, so please use your favourite editor to change the following values. Keybindings are a combination of an accelerator+key. + +### Accelerators + +Accelerators can be set to any _GdkModifierType_ mask value. The full list of _GdkModifierType_ values is available [here](http://gtk.php.net/manual/en/html/gdk/gdk.enum.modifiertype.html) + +Mask values can be combined by ORing them. For example, to set the delete tab accelerator to Ctrl+Shift, change the option "del_tab_accelerator" value to "5". This number comes from ORing GDK_SHIFT_MASK and GDK_CONTROL_MASK. + +I realise that this configuration is not user-friendly, but... :-P + +Quick reference: Shift(1), Cps-Lock(2), Ctrl(4), Alt(8), Ctrl-S(5), Ctrl-A(12), Ctrl-A-S(13) + +### Keys + +To change default keys, set the key value you want to modify to your desired key. For example, if you want to use the "D" key instead of the "W" key to delete a tab, set "del_tab_key" to "D" in the config file. + +### Default keybindings + + Ctrl + Shift + T -> New tab + Ctrl + Shift + W -> Close current tab + Ctrl + Shift + C -> Copy selected text + Ctrl + Shift + V -> Paste selected text + Ctrl + Shift + N -> Set tab name + + Ctrl + Left cursor -> Previous tab + Ctrl + Right cursor -> Next tab + Ctrl + Shift + Left cursor -> Move tab to the left + Ctrl + Shift + Right cursor -> Move tab to the right + Ctrl + [1-9] -> Switch to tab N (1-9) + + Ctrl + Shift + S -> Toggle/Untoggle scrollbar + Ctrl + Shift + Mouse left button -> Open link + F11 -> Fullscreen + Shift + PageUp -> Move up through scrollback by page + Shift + PageDown -> Move down through scrollback by page + Ctrl + Shift + Up -> Move up through scrollback by line + Ctrl + Shift + Down -> Move down through scrollback by line + Ctrl + Shift + [F1-F6] -> Select the colorset for the current tab + +You can also increase and decrease the font size in the GTK standard way: + + Ctrl + '+' -> Increase font size + Ctrl + '-' -> Decrease font size + +By default, mouse buttons are bound to the following: + + Button1 -> No action + Button2 -> Paste + Button3 -> Context menu + +Behavior can be changed with the following config settings: + + copy_on_select -> set to true to automatically copy selected text + paste_button -> set to desired mouse button (default: 2) + menu_button -> set to desired mouse button (default: 3) + +## Contributing +Pull requests are welcome. But please, create first a bug report in [Launchpad](https://bugs.launchpad.net/sakura), particularly if you plan to make major changes, to make sure your patch will be merged into **sakura**. If you'd like to contribute with translations, use the translations framework in [Launchpad](https://translations.launchpad.net/sakura) or send [me](mailto:dabisu@gmail.com) directly the translated po file. + +## License +[GPL 2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) + +\ +Enjoy **sakura**! diff -Nru sakura-3.8.3/sakura.pod sakura-3.8.4/sakura.pod --- sakura-3.8.3/sakura.pod 2021-07-22 17:05:41.000000000 +0000 +++ sakura-3.8.4/sakura.pod 2021-10-15 00:55:05.000000000 +0000 @@ -146,13 +146,13 @@ =head2 KEYS For example, to set the add tab key to 'T': - + add_tab_key=T -Before sakura used keycodes instead of strings. They're still valid. +Before sakura used keycodes instead of strings. They're still valid. -=head2 DEFAULTS +=head2 DEFAULTS Ctrl + Shift + T -> New tab Ctrl + Shift + W -> Close current tab @@ -170,7 +170,7 @@ Ctrl + Shift + Down -> Move down through scrollback by line You can also increase and decrease the font size in the GTK+ standard way (not configurable): - + Ctrl + '+' -> Increase font size Ctrl + '-' -> Decrease font size @@ -182,7 +182,7 @@ =head1 AUTHORS -B was written by David Gómez . +B was written by David Gómez . This manual page was written by Andrew Starr-Bochicchio . diff -Nru sakura-3.8.3/src/sakura.c sakura-3.8.4/src/sakura.c --- sakura-3.8.3/src/sakura.c 2021-07-22 17:05:41.000000000 +0000 +++ sakura-3.8.4/src/sakura.c 2021-10-15 00:55:05.000000000 +0000 @@ -61,22 +61,22 @@ /* 16 color palettes in GdkRGBA format (red, green, blue, alpha) */ const GdkRGBA gruvbox_palette[PALETTE_SIZE] = { - {0.156863, 0.156863, 0.156863, 1.000000}, - {0.800000, 0.141176, 0.113725, 1.000000}, - {0.596078, 0.592157, 0.101961, 1.000000}, - {0.843137, 0.600000, 0.129412, 1.000000}, - {0.270588, 0.521569, 0.533333, 1.000000}, - {0.694118, 0.384314, 0.525490, 1.000000}, - {0.407843, 0.615686, 0.415686, 1.000000}, - {0.658824, 0.600000, 0.517647, 1.000000}, - {0.572549, 0.513725, 0.454902, 1.000000}, - {0.984314, 0.286275, 0.203922, 1.000000}, - {0.721569, 0.733333, 0.149020, 1.000000}, - {0.980392, 0.741176, 0.184314, 1.000000}, - {0.513725, 0.647059, 0.596078, 1.000000}, - {0.827451, 0.525490, 0.607843, 1.000000}, - {0.556863, 0.752941, 0.486275, 1.000000}, - {0.921569, 0.858824, 0.698039, 1.000000}, + {0.156863, 0.156863, 0.156863, 1.000000}, + {0.800000, 0.141176, 0.113725, 1.000000}, + {0.596078, 0.592157, 0.101961, 1.000000}, + {0.843137, 0.600000, 0.129412, 1.000000}, + {0.270588, 0.521569, 0.533333, 1.000000}, + {0.694118, 0.384314, 0.525490, 1.000000}, + {0.407843, 0.615686, 0.415686, 1.000000}, + {0.658824, 0.600000, 0.517647, 1.000000}, + {0.572549, 0.513725, 0.454902, 1.000000}, + {0.984314, 0.286275, 0.203922, 1.000000}, + {0.721569, 0.733333, 0.149020, 1.000000}, + {0.980392, 0.741176, 0.184314, 1.000000}, + {0.513725, 0.647059, 0.596078, 1.000000}, + {0.827451, 0.525490, 0.607843, 1.000000}, + {0.556863, 0.752941, 0.486275, 1.000000}, + {0.921569, 0.858824, 0.698039, 1.000000} }; const GdkRGBA tango_palette[PALETTE_SIZE] = { @@ -118,7 +118,7 @@ }; const GdkRGBA solarized_palette[PALETTE_SIZE] = { - {0.027451, 0.211765, 0.258824, 1}, // 0 base02 + {0.027451, 0.211765, 0.258824, 1}, // 0 base02 {0.862745, 0.196078, 0.184314, 1}, // 1 red {0.521569, 0.600000, 0.000000, 1}, // 2 green {0.709804, 0.537255, 0.000000, 1}, // 3 yellow @@ -137,61 +137,61 @@ }; const GdkRGBA nord_palette[PALETTE_SIZE] = { - {0.0, 0.0, 0.0234375, 1.0}, - {0.74609375, 0.37890625, 0.4140625, 1.0}, - {0.63671875, 0.7421875, 0.546875, 1.0}, - {0.91796875, 0.79296875, 0.54296875, 1.0}, - {0.50390625, 0.62890625, 0.75390625, 1.0}, - {0.703125, 0.5546875, 0.67578125, 1.0}, - {0.53125, 0.75, 0.8125, 1.0}, - {0.89453125, 0.91015625, 0.9375, 1.0}, - {0.296875, 0.3359375, 0.4140625, 1.0}, - {0.74609375, 0.37890625, 0.4140625, 1.0}, - {0.63671875, 0.7421875, 0.546875, 1.0}, - {0.91796875, 0.79296875, 0.54296875, 1.0}, - {0.50390625, 0.62890625, 0.75390625, 1.0}, - {0.703125, 0.5546875, 0.67578125, 1.0}, - {0.55859375, 0.734375, 0.73046875, 1.0}, - {0.921875, 0.93359375, 0.953125, 1.0}, + {0.0, 0.0, 0.0234375, 1.0}, + {0.74609375, 0.37890625, 0.4140625, 1.0}, + {0.63671875, 0.7421875, 0.546875, 1.0}, + {0.91796875, 0.79296875, 0.54296875, 1.0}, + {0.50390625, 0.62890625, 0.75390625, 1.0}, + {0.703125, 0.5546875, 0.67578125, 1.0}, + {0.53125, 0.75, 0.8125, 1.0}, + {0.89453125, 0.91015625, 0.9375, 1.0}, + {0.296875, 0.3359375, 0.4140625, 1.0}, + {0.74609375, 0.37890625, 0.4140625, 1.0}, + {0.63671875, 0.7421875, 0.546875, 1.0}, + {0.91796875, 0.79296875, 0.54296875, 1.0}, + {0.50390625, 0.62890625, 0.75390625, 1.0}, + {0.703125, 0.5546875, 0.67578125, 1.0}, + {0.55859375, 0.734375, 0.73046875, 1.0}, + {0.921875, 0.93359375, 0.953125, 1.0} }; const GdkRGBA xterm_palette[PALETTE_SIZE] = { - {0, 0, 0, 1}, - {0.803922, 0, 0, 1}, - {0, 0.803922, 0, 1}, - {0.803922, 0.803922, 0, 1}, - {0.117647, 0.564706, 1, 1}, - {0.803922, 0, 0.803922, 1}, - {0, 0.803922, 0.803922, 1}, - {0.898039, 0.898039, 0.898039, 1}, - {0.298039, 0.298039, 0.298039, 1}, - {1, 0, 0, 1}, - {0, 1, 0, 1}, - {1, 1, 0, 1}, - {0.27451, 0.509804, 0.705882, 1}, - {1, 0, 1, 1}, - {0, 1, 1, 1}, - {1, 1, 1, 1} + {0, 0, 0, 1}, + {0.803922, 0, 0, 1}, + {0, 0.803922, 0, 1}, + {0.803922, 0.803922, 0, 1}, + {0.117647, 0.564706, 1, 1}, + {0.803922, 0, 0.803922, 1}, + {0, 0.803922, 0.803922, 1}, + {0.898039, 0.898039, 0.898039, 1}, + {0.298039, 0.298039, 0.298039, 1}, + {1, 0, 0, 1}, + {0, 1, 0, 1}, + {1, 1, 0, 1}, + {0.27451, 0.509804, 0.705882, 1}, + {1, 0, 1, 1}, + {0, 1, 1, 1}, + {1, 1, 1, 1} }; const GdkRGBA rxvt_palette[PALETTE_SIZE] = { - {0, 0, 0, 1 }, - {0.803921, 0, 0, 1 }, - {0, 0.803921, 0, 1 }, - {0.803921, 0.803921, 0, 1 }, - {0, 0, 0.803921, 1 }, - {0.803921, 0, 0.803921, 1 }, - {0, 0.803921, 0.803921, 1 }, - {0.980392, 0.921568, 0.843137, 1 }, - {0.250980, 0.250980, 0.250980, 1 }, - {1, 0, 0, 1 }, - {0, 1, 0, 1 }, - {1, 1, 0, 1 }, - {0, 0, 1, 1 }, - {1, 0, 1, 1 }, - {0, 1, 1, 1 }, - {1, 1, 1, 1 } + {0, 0, 0, 1}, + {0.803921, 0, 0, 1}, + {0, 0.803921, 0, 1}, + {0.803921, 0.803921, 0, 1}, + {0, 0, 0.803921, 1}, + {0.803921, 0, 0.803921, 1}, + {0, 0.803921, 0.803921, 1}, + {0.980392, 0.921568, 0.843137, 1}, + {0.250980, 0.250980, 0.250980, 1}, + {1, 0, 0, 1}, + {0, 1, 0, 1}, + {1, 1, 0, 1}, + {0, 0, 1, 1}, + {1, 0, 1, 1}, + {0, 1, 1, 1}, + {1, 1, 1, 1} }; const char *palettes_names[]= {"Solarized", "Tango", "Gruvbox","Nord","Xterm","Linux", "Rxvt", NULL}; @@ -208,14 +208,14 @@ #define NUM_SCHEMES 5 #define DEFAULT_SCHEME 1 struct scheme predefined_schemes[NUM_SCHEMES] = { - {"Custom", {0, 0, 0, 1}, {1, 1, 1, 1}}, /* Custom values are ignored, we use the ones choosed by the user */ + {"Custom", {0, 0, 0, 1}, {1, 1, 1, 1}}, /* Custom values are ignored, we use the ones chosen by the user */ {"White on black", {0, 0, 0, 1}, {1, 1, 1, 1}}, {"Green on black", {0, 0, 0, 1}, {0.4, 1, 0, 1}}, {"Solarized dark", {0.000000, 0.168627, 0.211765, 1}, {0.513725, 0.580392, 0.588235, 1}}, {"Solarized light", {0.992157, 0.964706, 0.890196, 1}, {0.396078, 0.482353, 0.513725, 1}} }; -/* CSS definitions. Global CSS is empty, justt drop here you CSS to personalize widgets */ +/* CSS definitions. Global CSS is empty, just drop here you CSS to personalize widgets */ #define SAKURA_CSS "" #define FADE_WINDOW_CSS "\ @@ -236,12 +236,12 @@ GtkWidget *main_window; GtkWidget *notebook; GtkWidget *menu; - GtkWidget *fade_window; /* Window used for fading effect */ + GtkWidget *fade_window; /* Window used for fading effect */ PangoFontDescription *font; GdkRGBA forecolors[NUM_COLORSETS]; GdkRGBA backcolors[NUM_COLORSETS]; GdkRGBA curscolors[NUM_COLORSETS]; - guint schemes[NUM_COLORSETS]; /* Selected color scheme for each colorset */ + guint schemes[NUM_COLORSETS]; /* Selected color scheme for each colorset */ const GdkRGBA *palette; guint palette_idx; gint last_colorset; @@ -368,7 +368,7 @@ /* make this an array instead of #defines to get a compile time * error instead of a runtime if NUM_COLORSETS changes */ -static int cs_keys[NUM_COLORSETS] = +static int cs_keys[NUM_COLORSETS] = {GDK_KEY_F1, GDK_KEY_F2, GDK_KEY_F3, GDK_KEY_F4, GDK_KEY_F5, GDK_KEY_F6}; #define ERROR_BUFFER_LENGTH 256 @@ -427,7 +427,7 @@ static void sakura_page_removed_cb (GtkWidget *, void *); static gboolean sakura_notebook_scroll_cb (GtkWidget *, GdkEventScroll *); static gboolean sakura_label_clicked_cb (GtkWidget *, GdkEventButton *, void *); -static gboolean sakura_notebook_focus_cb (GtkWindow *, GdkEvent *, void *); +static gboolean sakura_notebook_focus_cb (GtkWindow *, GdkEvent *, void *); static void sakura_closebutton_clicked_cb (GtkWidget *, void *); /* Menuitem callbacks */ static void sakura_font_dialog_cb (GtkWidget *, void *); @@ -450,19 +450,19 @@ static void sakura_disable_numbered_tabswitch_cb (GtkWidget *, void *); //static void sakura_use_fading_cb (GtkWidget *, void *); static void sakura_setname_entry_changed_cb (GtkWidget *, void *); -static void sakura_set_cursor_cb (GtkWidget *, void *); -static void sakura_blinking_cursor_cb (GtkWidget *, void *); -static void sakura_audible_bell_cb (GtkWidget *, void *); -static void sakura_urgent_bell_cb (GtkWidget *, void *); +static void sakura_set_cursor_cb (GtkWidget *, void *); +static void sakura_blinking_cursor_cb (GtkWidget *, void *); +static void sakura_audible_bell_cb (GtkWidget *, void *); +static void sakura_urgent_bell_cb (GtkWidget *, void *); /* Misc */ static void sakura_error (const char *, ...); -static void sakura_build_command (int *, char ***); -static char * sakura_get_term_cwd (struct sakura_tab *); +static void sakura_build_command (int *, char ***); +static char * sakura_get_term_cwd (struct sakura_tab *); static guint sakura_tokeycode (guint key); static void sakura_set_keybind (const gchar *, guint); static guint sakura_get_keybind (const gchar *); -static void sakura_sanitize_working_directory (void); +static void sakura_sanitize_working_directory (void); /* Functions */ static void sakura_init (); @@ -542,7 +542,7 @@ page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); - + /* Use keycodes instead of keyvals. With keyvals, key bindings work only in US/ISO8859-1 and similar locales */ guint keycode = event->hardware_keycode; @@ -563,16 +563,16 @@ switch_tab_accelerator=4 for ctrl+next[prev]_tab_key move_tab_accelerator=5 for ctrl+shift+next[prev]_tab_key move never works, because switch will be processed first, so it needs to be fixed with the following condition */ - if ( ((event->state & sakura.switch_tab_accelerator) == sakura.switch_tab_accelerator) && + if ( ((event->state & sakura.switch_tab_accelerator) == sakura.switch_tab_accelerator) && ((event->state & sakura.move_tab_accelerator) != sakura.move_tab_accelerator) ) { /* Just propagate the event if there is only one tab */ - if(npages < 2) return FALSE; + if (npages < 2) return FALSE; - if ((keycode >= sakura_tokeycode(GDK_KEY_1)) && (keycode <= sakura_tokeycode( GDK_KEY_9))) { + if ((keycode >= sakura_tokeycode(GDK_KEY_1)) && (keycode <= sakura_tokeycode( GDK_KEY_9))) { /* User has explicitly disabled this branch, make sure to propagate the event */ - if(sakura.disable_numbered_tabswitch) return FALSE; + if (sakura.disable_numbered_tabswitch) return FALSE; if (sakura_tokeycode(GDK_KEY_1) == keycode) topage = 0; else if (sakura_tokeycode(GDK_KEY_2) == keycode) topage = 1; @@ -600,11 +600,11 @@ gtk_notebook_next_page(GTK_NOTEBOOK(sakura.notebook)); } return TRUE; - } + } } /* Move tab keybinding pressed */ - if ( ((event->state & sakura.move_tab_accelerator) == sakura.move_tab_accelerator)) { + if ( ((event->state & sakura.move_tab_accelerator) == sakura.move_tab_accelerator)) { if (keycode == sakura_tokeycode(sakura.prev_tab_key)) { sakura_move_tab(BACKWARDS); return TRUE; @@ -661,7 +661,7 @@ } /* F11 (fullscreen) pressed */ - if (keycode == sakura_tokeycode(sakura.fullscreen_key)){ + if (keycode == sakura_tokeycode(sakura.fullscreen_key)) { sakura_fullscreen_cb(NULL, NULL); return TRUE; } @@ -669,8 +669,8 @@ /* Change in colorset */ if ( (event->state & sakura.set_colorset_accelerator) == sakura.set_colorset_accelerator ) { int i; - for(i=0; idirection) { + + switch (event->direction) { case GDK_SCROLL_DOWN: gtk_notebook_set_current_page(GTK_NOTEBOOK(sakura.notebook), --page >= 0 ? page : npages - 1); break; @@ -787,12 +787,12 @@ } -/* Callback called when the user switchs tabs or closes a tab (but not when a tab is added) */ +/* Callback called when the user switches tabs or closes a tab (but not when a tab is added) */ static void sakura_switch_page_cb (GtkWidget *widget, GtkWidget *widget_page, guint page_num, void *data) { struct sakura_tab *sk_tab; - + /* Don't use gtk_notebook_get_current_page in the callbacks, it returns the previous page */ sk_tab = sakura_get_sktab(sakura, page_num); @@ -839,9 +839,9 @@ { GtkWidget *hbox = (GtkWidget *)data; gint page; - + page = gtk_notebook_page_num(GTK_NOTEBOOK(sakura.notebook), hbox); - + sakura_close_tab(page); } @@ -853,14 +853,14 @@ GtkWidget *hbox = (GtkWidget *)data; struct sakura_tab *sk_tab; gint page; - + page = gtk_notebook_page_num(GTK_NOTEBOOK(sakura.notebook), hbox); sk_tab = sakura_get_sktab(sakura, page); /* Not interested in non button press events */ - if (button_event->type != GDK_BUTTON_PRESS) + if (button_event->type != GDK_BUTTON_PRESS) return FALSE; - + /* Left button click. We HAVE to propagate the event, or things like tab moving won't work */ if (button_event->button == 1) { gtk_widget_grab_focus(sk_tab->vte); @@ -868,7 +868,7 @@ } /* Ignore right click and propagate the event */ - if (button_event->button == 3) + if (button_event->button == 3) return FALSE; /* The middle button was clicked, so close the tab */ @@ -931,14 +931,14 @@ return TRUE; } - /* Show the popup menu whe menu button is pressed */ + /* Show the popup menu when menu button is pressed */ if (button_event->button == sakura.menu_button) { GtkMenu *menu; menu = GTK_MENU (widget); if (sakura.current_match) { /* Show the extra options in the menu */ - + char *matches; /* Is it a mail address? */ if (vte_terminal_event_check_regex_simple(VTE_TERMINAL(sk_tab->vte), (GdkEvent *) button_event, @@ -989,7 +989,7 @@ gint new_size; /* Increment font size one unit */ - new_size=pango_font_description_get_size(sakura.font)+PANGO_SCALE; + new_size = pango_font_description_get_size(sakura.font)+PANGO_SCALE; pango_font_description_set_size(sakura.font, new_size); sakura_set_font(); @@ -1004,10 +1004,10 @@ gint new_size; /* Decrement font size one unit */ - new_size =pango_font_description_get_size(sakura.font)-PANGO_SCALE; - + new_size = pango_font_description_get_size(sakura.font)-PANGO_SCALE; + /* Set a minimal size */ - if (new_size >= FONT_MINIMAL_SIZE ) { + if (new_size >= FONT_MINIMAL_SIZE) { pango_font_description_set_size(sakura.font, new_size); sakura_set_font(); sakura_set_size(); @@ -1112,8 +1112,8 @@ } else { return TRUE; } - } - + } + } } @@ -1200,7 +1200,7 @@ gtk_box_pack_start(GTK_BOX(name_hbox), label, TRUE, TRUE, 12); gtk_box_pack_start(GTK_BOX(name_hbox), entry, TRUE, TRUE, 12); gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(input_dialog))), name_hbox, FALSE, FALSE, 12); - + /* Disable accept button until some text is entered */ g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(sakura_setname_entry_changed_cb), input_dialog); gtk_dialog_set_response_sensitive(GTK_DIALOG(input_dialog), GTK_RESPONSE_ACCEPT, FALSE); @@ -1235,9 +1235,9 @@ GtkComboBox *scheme_combo = g_object_get_data (G_OBJECT(dialog), "scheme_combo"); GtkSpinButton *opacity_spin = g_object_get_data(G_OBJECT(dialog), "opacity_spin"); GtkCheckButton *bib_checkbutton = g_object_get_data (G_OBJECT(dialog), "bib_checkbutton"); - + gint current_cs = gtk_combo_box_get_active(cs_combo); - + /* If we come here as a result of a change in the active colorset, load the new colorset to the buttons. * Else, the color buttons or opacity spin have gotten a new value, store that. */ if ((GtkWidget *)cs_combo == widget ) { @@ -1246,12 +1246,12 @@ gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(fore_button), &forecolors[current_cs]); gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(back_button), &backcolors[current_cs]); gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(curs_button), &curscolors[current_cs]); - gtk_spin_button_set_value(opacity_spin, new_opacity); + gtk_spin_button_set_value(opacity_spin, new_opacity); gtk_combo_box_set_active(GTK_COMBO_BOX(scheme_combo), sakura.schemes[current_cs]); } else if ((GtkWidget *)scheme_combo == widget) { /* Scheme has changed, update the buttons. No cursor and no alpha */ int selected_scheme = gtk_combo_box_get_active(GTK_COMBO_BOX(scheme_combo)); - if (selected_scheme != 0) { + if (selected_scheme != 0) { float old_alpha = backcolors[current_cs].alpha; /* Keep the previous alpha */ gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(fore_button), &predefined_schemes[selected_scheme].fg); gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(back_button), &predefined_schemes[selected_scheme].bg); @@ -1272,7 +1272,7 @@ gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(back_button), &backcolors[current_cs]); gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(curs_button), &curscolors[current_cs]); gtk_spin_button_update(opacity_spin); - backcolors[current_cs].alpha = gtk_spin_button_get_value(opacity_spin)/100; + backcolors[current_cs].alpha = gtk_spin_button_get_value(opacity_spin)/100; /* User changed colors. Set custom scheme */ sakura.schemes[current_cs] = 0; gtk_combo_box_set_active(GTK_COMBO_BOX(scheme_combo), sakura.schemes[current_cs]); @@ -1294,9 +1294,9 @@ GtkAdjustment *spin_adj; struct sakura_tab *sk_tab; gint response; - gint page, i; - - + gint page, i; + + page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); sk_tab = sakura_get_sktab(sakura, page); @@ -1308,14 +1308,14 @@ color_header = gtk_dialog_get_header_bar(GTK_DIALOG(color_dialog)); gtk_header_bar_set_show_close_button(GTK_HEADER_BAR(color_header), FALSE); gtk_dialog_set_default_response(GTK_DIALOG(color_dialog), GTK_RESPONSE_ACCEPT); - + /* Add the combobox to select the current colorset */ cs_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); cs_label = gtk_label_new(_("Colorset")); cs_combo = gtk_combo_box_text_new(); gchar combo_text[3]; for (i=0; i < NUM_COLORSETS; i++) { - g_snprintf(combo_text, 2, "%d", i+1); + g_snprintf(combo_text, 2, "%d", i+1); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(cs_combo), NULL, combo_text); } gtk_combo_box_set_active(GTK_COMBO_BOX(cs_combo), sk_tab->colorset); @@ -1328,7 +1328,7 @@ gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(scheme_combo), NULL, predefined_schemes[i].name); } gtk_combo_box_set_active(GTK_COMBO_BOX(scheme_combo), sakura.schemes[sk_tab->colorset]); - + /* Foreground and background and cursor color buttons */ fore_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); back_hbox = gtk_box_new(FALSE, 12); @@ -1341,17 +1341,17 @@ curs_button = gtk_color_button_new_with_rgba(&sakura.curscolors[sk_tab->colorset]); /* Opacity control */ - opacity_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); + opacity_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); spin_adj = gtk_adjustment_new ((sakura.backcolors[sk_tab->colorset].alpha)*100, 0.0, 100.0, 1.0, 5.0, 0); opacity_spin = gtk_spin_button_new(GTK_ADJUSTMENT(spin_adj), 1.0, 0); opacity_label = gtk_label_new(_("Opacity level (%)")); /* Palette combobox */ - palette_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); + palette_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); palette_label = gtk_label_new(_("Palette")); palette_combo = gtk_combo_box_text_new(); for (i=0; i < sizeof(&palettes_names)-1; i++) { - gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(palette_combo), NULL, palettes_names[i]); + gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(palette_combo), NULL, palettes_names[i]); } gtk_combo_box_set_active(GTK_COMBO_BOX(palette_combo), sakura.palette_idx); @@ -1359,7 +1359,7 @@ bib_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); bib_checkbutton = gtk_check_button_new_with_label(_("Use bright colors for bold text")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bib_checkbutton), sakura.bold_is_bright); - + gtk_box_pack_start(GTK_BOX(cs_hbox), cs_label, FALSE, FALSE, 12); gtk_box_pack_end(GTK_BOX(cs_hbox), cs_combo, FALSE, FALSE, 12); gtk_box_pack_start(GTK_BOX(scheme_hbox), scheme_label, FALSE, FALSE, 12); @@ -1406,24 +1406,24 @@ g_signal_connect(G_OBJECT(opacity_spin), "changed", G_CALLBACK(sakura_color_dialog_changed_cb), color_dialog); g_signal_connect(G_OBJECT(bib_checkbutton), "toggled", G_CALLBACK(sakura_color_dialog_changed_cb), color_dialog); - for(i=0; icolorset = gtk_combo_box_get_active(GTK_COMBO_BOX(cs_combo)); sakura_set_config_integer("last_colorset", sk_tab->colorset+1); - + /* Set the selected palette */ guint palette_idx = gtk_combo_box_get_active(GTK_COMBO_BOX(palette_combo)); sakura.palette = palettes[palette_idx]; @@ -1456,7 +1456,7 @@ /* Set bold is bright option */ sakura_set_config_boolean("bold_is_bright", sakura.bold_is_bright); - + /* Apply the new colorsets to all tabs */ sakura_set_colors(); } @@ -1474,7 +1474,7 @@ GtkWidget *title_hbox; gint response; - title_dialog=gtk_dialog_new_with_buttons(_("Set window title"), + title_dialog=gtk_dialog_new_with_buttons(_("Set window title"), GTK_WINDOW(sakura.main_window), GTK_DIALOG_MODAL|GTK_DIALOG_USE_HEADER_BAR, _("_Cancel"), GTK_RESPONSE_CANCEL, @@ -1495,7 +1495,7 @@ gtk_box_pack_start(GTK_BOX(title_hbox), label, TRUE, TRUE, 12); gtk_box_pack_start(GTK_BOX(title_hbox), entry, TRUE, TRUE, 12); gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(title_dialog))), title_hbox, FALSE, FALSE, 12); - + /* Disable accept button until some text is entered */ g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(sakura_setname_entry_changed), title_dialog); gtk_dialog_set_response_sensitive(GTK_DIALOG(title_dialog), GTK_RESPONSE_ACCEPT, FALSE); @@ -1504,7 +1504,7 @@ response=gtk_dialog_run(GTK_DIALOG(title_dialog)); if (response==GTK_RESPONSE_ACCEPT) { - /* Bug #257391 shadow reachs here too... */ + /* Bug #257391 shadow reaches here too... */ gtk_window_set_title(GTK_WINDOW(sakura.main_window), gtk_entry_get_text(GTK_ENTRY(entry))); } gtk_widget_destroy(title_dialog); @@ -1701,7 +1701,7 @@ sakura.cursor_type=VTE_CURSOR_SHAPE_UNDERLINE; } else if (strcmp(cursor_string, "ibeam")==0) { sakura.cursor_type=VTE_CURSOR_SHAPE_IBEAM; - } + } for (i = (n_pages - 1); i >= 0; i--) { sk_tab = sakura_get_sktab(sakura, i); @@ -1821,9 +1821,9 @@ sakura.config_modified=false; configdir = g_build_filename( g_get_user_config_dir(), "sakura", NULL ); - if( ! g_file_test( g_get_user_config_dir(), G_FILE_TEST_EXISTS) ) + if ( ! g_file_test( g_get_user_config_dir(), G_FILE_TEST_EXISTS) ) g_mkdir( g_get_user_config_dir(), 0755 ); - if( ! g_file_test( configdir, G_FILE_TEST_EXISTS) ) + if ( ! g_file_test( configdir, G_FILE_TEST_EXISTS) ) g_mkdir( configdir, 0755 ); if (option_config_file) { sakura.configfile = g_build_filename(configdir, option_config_file, NULL); @@ -1842,12 +1842,12 @@ exit(EXIT_FAILURE); } } - + /* Add GFile monitor to control file external changes */ GFile *cfgfile = g_file_new_for_path(sakura.configfile); GFileMonitor *mon_cfgfile = g_file_monitor_file (cfgfile, 0, NULL, NULL); g_signal_connect(G_OBJECT(mon_cfgfile), "changed", G_CALLBACK(sakura_conf_changed_cb), NULL); - + gchar *cfgtmp = NULL; /* We can safely ignore errors from g_key_file_get_value(), since if the @@ -1857,8 +1857,8 @@ * doesn't exist, but we have just read it! */ - for( i=0; i=2 || sakura.first_tab) { /* TODO: Yeah i know, this is utter shit. Remove this ugly hack and set geometry hints*/ - if (!sakura.show_scrollbar) + if (!sakura.show_scrollbar) //sakura.height += min_height - 10; sakura.height += 10; else @@ -2646,15 +2652,15 @@ gtk_widget_get_preferred_width(sk_tab->scrollbar, &min_width, &natural_width); //SAY("SCROLLBAR min width %d natural width %d", min_width, natural_width); - if(sakura.show_scrollbar) { + if (sakura.show_scrollbar) { sakura.width += min_width; } /* GTK does not ignore resize for maximized windows on some systems, so we do need check if it's maximized or not */ GdkWindow *gdk_window = gtk_widget_get_window(GTK_WIDGET(sakura.main_window)); - if(gdk_window != NULL) { - if(gdk_window_get_state(gdk_window) & GDK_WINDOW_STATE_MAXIMIZED) { + if (gdk_window != NULL) { + if (gdk_window_get_state(gdk_window) & GDK_WINDOW_STATE_MAXIMIZED) { SAY("window is maximized, will not resize"); return; } @@ -2682,7 +2688,7 @@ } /* Set colorset when colosert keybinding is used */ -static void +static void sakura_set_colorset (int cs) { gint page; @@ -2692,7 +2698,7 @@ return; page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); - sk_tab = sakura_get_sktab(sakura, page); + sk_tab = sakura_get_sktab(sakura, page); sk_tab->colorset = cs; sakura_set_config_integer("last_colorset", sk_tab->colorset+1); @@ -2702,7 +2708,7 @@ /* Set the terminal colors for all notebook tabs */ -static void +static void sakura_set_colors () { int i; @@ -2714,16 +2720,16 @@ /* Set fore, back, cursor color and palette for the terminal's colorset */ vte_terminal_set_colors(VTE_TERMINAL(sk_tab->vte), - &sakura.forecolors[sk_tab->colorset], + &sakura.forecolors[sk_tab->colorset], &sakura.backcolors[sk_tab->colorset], sakura.palette, PALETTE_SIZE); vte_terminal_set_color_cursor(VTE_TERMINAL(sk_tab->vte), &sakura.curscolors[sk_tab->colorset]); /* Use background color to make text visible when the cursor is over it */ vte_terminal_set_color_cursor_foreground(VTE_TERMINAL(sk_tab->vte), &sakura.backcolors[sk_tab->colorset]); - + vte_terminal_set_bold_is_bright(VTE_TERMINAL(sk_tab->vte), sakura.bold_is_bright); - + } /* Main window opacity must be set. Otherwise vte widget will remain opaque */ @@ -2760,7 +2766,7 @@ struct sakura_tab *sk_tab; n_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); - + matched_page = -1; page = 0; @@ -2787,7 +2793,7 @@ if ((title != NULL) && (g_strcmp0(title, "") != 0)) { /* Chop to max size */ - chopped_title = g_strndup(title, TAB_MAX_SIZE); + chopped_title = g_strndup(title, TAB_MAX_SIZE); /* Honor the minimum tab label size */ while (strlen(chopped_title)< TAB_MIN_SIZE) { char *old_ptr = chopped_title; @@ -2809,7 +2815,7 @@ sakura_spawn_callback (VteTerminal *vte, GPid pid, GError *error, gpointer user_data) { struct sakura_tab *sk_tab = (struct sakura_tab *) user_data; - + if (pid == -1) { /* Fork has failed */ SAY("Error: %s", error->message); } else { @@ -2832,19 +2838,19 @@ /* Create the tab label */ sk_tab->label = gtk_label_new(NULL); gtk_label_set_ellipsize(GTK_LABEL(sk_tab->label), PANGO_ELLIPSIZE_END); - + /* Create hbox for our label & button */ tab_title_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2); gtk_widget_set_hexpand(tab_title_hbox, TRUE); /* Label widgets has no window associated, so we need an event box to catch click events */ - event_box = gtk_event_box_new(); + event_box = gtk_event_box_new(); gtk_container_add(GTK_CONTAINER(event_box), sk_tab->label); gtk_widget_set_events(event_box, GDK_BUTTON_PRESS_MASK); - + /* Expand&fill the event_box to get click events all along the tab */ gtk_box_pack_start(GTK_BOX(tab_title_hbox), event_box, TRUE, TRUE, 0); - + /* If the tab close button is enabled, create and add it to the tab */ if (sakura.show_closebutton) { close_button = gtk_button_new(); @@ -2864,7 +2870,7 @@ } gtk_widget_show_all(tab_title_hbox); - + /* Create new vte terminal, scrollbar, and pack it */ sk_tab->vte = vte_terminal_new(); sk_tab->scrollbar = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(sk_tab->vte))); @@ -2893,7 +2899,7 @@ } gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(sakura.notebook), sk_tab->hbox, TRUE); - + sakura_set_sktab(sakura, index, sk_tab ); /* vte signals */ @@ -2905,7 +2911,7 @@ g_signal_connect(G_OBJECT(sk_tab->vte), "window-title-changed", G_CALLBACK(sakura_title_changed_cb), NULL); g_signal_connect_swapped(G_OBJECT(sk_tab->vte), "button-press-event", G_CALLBACK(sakura_term_buttonpressed_cb), sakura.menu); g_signal_connect_swapped(G_OBJECT(sk_tab->vte), "button-release-event", G_CALLBACK(sakura_term_buttonreleased_cb), sakura.menu); - + /* Label & button signals */ /* We need the hbox to know which label/button was clicked */ g_signal_connect(G_OBJECT(event_box), "button_press_event", G_CALLBACK(sakura_label_clicked_cb), sk_tab->hbox); @@ -2917,7 +2923,7 @@ char *command_env[2] = {"TERM=xterm-256color",0}; /* First tab */ - npages=gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); + npages=gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); if (npages == 1) { if (sakura.first_tab) { gtk_notebook_set_show_tabs(GTK_NOTEBOOK(sakura.notebook), TRUE); @@ -2933,11 +2939,11 @@ sk_hints.base_width = vte_terminal_get_char_width(VTE_TERMINAL(sk_tab->vte)); sk_hints.base_height = vte_terminal_get_char_height(VTE_TERMINAL(sk_tab->vte)); sk_hints.min_width = vte_terminal_get_char_width(VTE_TERMINAL(sk_tab->vte)) * DEFAULT_MIN_WIDTH_CHARS; - sk_hints.min_height = vte_terminal_get_char_height(VTE_TERMINAL(sk_tab->vte)) * DEFAULT_MIN_HEIGHT_CHARS; + sk_hints.min_height = vte_terminal_get_char_height(VTE_TERMINAL(sk_tab->vte)) * DEFAULT_MIN_HEIGHT_CHARS; sk_hints.width_inc = vte_terminal_get_char_width(VTE_TERMINAL(sk_tab->vte)); sk_hints.height_inc = vte_terminal_get_char_height(VTE_TERMINAL(sk_tab->vte)); - gtk_window_set_geometry_hints(GTK_WINDOW(sakura.main_window), GTK_WIDGET (sk_tab->vte), &sk_hints, + gtk_window_set_geometry_hints(GTK_WINDOW(sakura.main_window), GTK_WIDGET (sk_tab->vte), &sk_hints, GDK_HINT_RESIZE_INC | GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE); sakura_set_font(); @@ -2991,14 +2997,14 @@ } vte_terminal_spawn_async(VTE_TERMINAL(sk_tab->vte), VTE_PTY_NO_HELPER, NULL, command_argv, command_env, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, -1, NULL, sakura_spawn_callback, sk_tab); - + free(path); g_strfreev(command_argv); g_strfreev(option_xterm_args); } } // else { /* No execute option */ - - /* Only fork if there is no execute option or if it has failed */ - if ( (!option_execute && !option_xterm_args) || (command_argc==0)) { + + /* Only fork if there is no execute option or if it has failed */ + if ( (!option_execute && !option_xterm_args) || (command_argc==0)) { if (option_hold == TRUE) { sakura_error("Hold option given without any command"); option_hold = FALSE; @@ -3030,7 +3036,7 @@ free(cwd); - /* Appling tab title pattern from config (https://answers.launchpad.net/sakura/+question/267951) */ + /* Applying tab title pattern from config (https://answers.launchpad.net/sakura/+question/267951) */ if (sakura.tab_default_title != NULL) { default_label_text = sakura.tab_default_title; sk_tab->label_set_byuser = true; @@ -3056,25 +3062,25 @@ } -/* Do all the work neccesary before & after deleting the tab passed as a parameter */ +/* Do all the work necessary before & after deleting the tab passed as a parameter */ static void sakura_close_tab (gint page) { gint npages, response; pid_t pgid; struct sakura_tab *sk_tab; GtkWidget *dialog; - + npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); sk_tab = sakura_get_sktab(sakura, page); /* Only write configuration to disk if it's the last tab */ - if (npages == 1) { + if (npages == 1) { sakura_config_done(); } /* Check if there are running processes for this tab. Use tcgetpgrp to compare to the shell PGID */ pgid = tcgetpgrp(vte_pty_get_fd(vte_terminal_get_pty(VTE_TERMINAL(sk_tab->vte)))); - + if ( (pgid != -1) && (pgid != sk_tab->pid) && (!sakura.less_questions) ) { dialog=gtk_message_dialog_new(GTK_WINDOW(sakura.main_window), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, @@ -3082,7 +3088,7 @@ response=gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); - if (response==GTK_RESPONSE_YES) + if (response==GTK_RESPONSE_YES) sakura_del_tab(page); } else /* No processes */ @@ -3106,7 +3112,7 @@ /* Do the first tab checks BEFORE deleting the tab, to ensure correct * sizes are calculated when the tab is deleted */ - if ( npages == 2) { + if (npages == 2) { if (sakura.first_tab) { gtk_notebook_set_show_tabs(GTK_NOTEBOOK(sakura.notebook), TRUE); } else { @@ -3137,7 +3143,7 @@ /* Don't save config file. Option only available thru the config file for users who know the risks */ if (sakura.dont_save) return; - + gchar *cfgdata = g_key_file_to_data(sakura.cfg, &len, &gerror); if (!cfgdata) { fprintf(stderr, "%s\n", gerror->message); @@ -3151,7 +3157,7 @@ if (sakura.externally_modified && !sakura.config_modified && !sakura.less_questions) { GtkWidget *dialog; gint response; - + dialog = gtk_message_dialog_new(GTK_WINDOW(sakura.main_window), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, _("Configuration has been modified by another process. Overwrite?")); @@ -3159,11 +3165,11 @@ response = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); - if (response == GTK_RESPONSE_YES) + if (response == GTK_RESPONSE_YES) overwrite = true; } - - /* Write to file IF there's been changes of IF we want to overwrite anothe process changes */ + + /* Write to file IF there's been changes of IF we want to overwrite another process changes */ if (sakura.config_modified || overwrite) { GIOChannel *cfgfile = g_io_channel_new_file(sakura.configfile, "w", &gerror); if (!cfgfile) { @@ -3270,7 +3276,7 @@ valname = gdk_keyval_name(value); g_key_file_set_string(sakura.cfg, cfg_group, key, valname); sakura.config_modified = TRUE; -} +} static guint @@ -3280,7 +3286,7 @@ guint retval = GDK_KEY_VoidSymbol; value = g_key_file_get_string(sakura.cfg, cfg_group, key, NULL); - if (value != NULL){ + if (value != NULL) { retval = gdk_keyval_from_name(value); g_free(value); } @@ -3318,7 +3324,7 @@ buf = malloc(sb.st_size + 1); - if(buf == NULL) { + if (buf == NULL) { g_free(file); return cwd; } @@ -3341,21 +3347,21 @@ static guint sakura_tokeycode (guint key) { - GdkKeymap *keymap; - GdkKeymapKey *keys; - gint n_keys; - guint res = 0; + GdkKeymap *keymap; + GdkKeymapKey *keys; + gint n_keys; + guint res = 0; keymap = gdk_keymap_get_for_display(gdk_display_get_default()); - if (gdk_keymap_get_entries_for_keyval(keymap, key, &keys, &n_keys)) { - if (n_keys > 0) { - res = keys[0].keycode; - } - g_free(keys); - } + if (gdk_keymap_get_entries_for_keyval(keymap, key, &keys, &n_keys)) { + if (n_keys > 0) { + res = keys[0].keycode; + } + g_free(keys); + } - return res; + return res; } @@ -3405,8 +3411,8 @@ n = 0; nargc = argc; have_e = FALSE; - for(i=0; i