/usr/share/perl5/Shutter/App/Toolbar.pm is in shutter 0.94-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | ###################################################
#
# Copyright (C) 2008-2013 Mario Kemper <mario.kemper@gmail.com>
#
# This file is part of Shutter.
#
# Shutter 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
# (at your option) any later version.
#
# Shutter 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 Shutter; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
###################################################
package Shutter::App::Toolbar;
#modules
#--------------------------------------
use utf8;
use strict;
use Gtk2;
#Glib
use Glib qw/TRUE FALSE/;
#--------------------------------------
sub new {
my $class = shift;
#constructor
my $self = { _common => shift };
bless $self, $class;
return $self;
}
sub create_toolbar {
my $self = shift;
my $d = $self->{_common}->get_gettext;
my $window = $self->{_common}->get_mainwindow;
my $shutter_root = $self->{_common}->get_root;
#Tooltips
my $tooltips = $self->{_common}->get_tooltips;
#Icontheme
my $icontheme = $self->{_common}->get_theme;
#button redoshot
#--------------------------------------
my $image_redoshot = Gtk2::Image->new_from_stock( 'gtk-refresh', 'large-toolbar' );
$self->{_redoshot} = Gtk2::ToolButton->new( $image_redoshot, $d->get("Redo") );
#~ $self->{_redoshot}->set_is_important (TRUE);
$tooltips->set_tip( $self->{_redoshot}, $d->get("Redo last screenshot") );
#--------------------------------------
#button selection
#--------------------------------------
my $image_select;
eval{
my $ccursor_pb = Gtk2::Gdk::Cursor->new('left_ptr')->get_image->scale_simple(Gtk2::IconSize->lookup('large-toolbar'), 'bilinear');
$image_select = Gtk2::Image->new_from_pixbuf($ccursor_pb);
};
if($@){
if($icontheme->has_icon('applications-accessories')){
$image_select = Gtk2::Image->new_from_icon_name( 'applications-accessories', 'large-toolbar' );
}else{
$image_select = Gtk2::Image->new_from_pixbuf(
Gtk2::Gdk::Pixbuf->new_from_file_at_size(
"$shutter_root/share/shutter/resources/icons/selection.svg", Gtk2::IconSize->lookup('large-toolbar')
)
);
}
}
$self->{_select} = Gtk2::ToolButton->new( $image_select, $d->get("Selection") );
#The GtkToolButton class uses this property to determine whether
#to show or hide its label when the toolbar style is GTK_TOOLBAR_BOTH_HORIZ.
#The result is that only tool buttons with the
#"is_important" property set have labels, an effect known as "priority text"
$self->{_select}->set_is_important (TRUE);
$tooltips->set_tip( $self->{_select}, $d->get("Draw a rectangular capture area with your mouse\nto select a specified screen area"), '' );
#--------------------------------------
#button full screen
#--------------------------------------
my $image_full;
if($icontheme->has_icon('user-desktop')){
$image_full = Gtk2::Image->new_from_icon_name( 'user-desktop', 'large-toolbar' );
}elsif($icontheme->has_icon('desktop')){
$image_full = Gtk2::Image->new_from_icon_name( 'desktop', 'large-toolbar' );
}else{
$image_full = Gtk2::Image->new_from_pixbuf(
Gtk2::Gdk::Pixbuf->new_from_file_at_size(
"$shutter_root/share/shutter/resources/icons/desktop.svg",
Gtk2::IconSize->lookup('large-toolbar')
)
);
}
$self->{_full} = Gtk2::MenuToolButton->new( $image_full, $d->get("Desktop") );
$self->{_full}->set_is_important (TRUE);
$tooltips->set_tip( $self->{_full}, $d->get("Take a screenshot of your whole desktop") );
$self->{_full}->set_arrow_tooltip( $tooltips, $d->get("Capture a specific workspace"), '' );
#--------------------------------------
#button active window
#--------------------------------------
#~ my $image_awindow;
#~ if($icontheme->has_icon('preferences-system-windows')){
#~ $image_awindow = Gtk2::Image->new_from_icon_name( 'preferences-system-windows', 'large-toolbar' );
#~ }else{
#~ $image_awindow = Gtk2::Image->new_from_pixbuf(
#~ Gtk2::Gdk::Pixbuf->new_from_file_at_size(
#~ "$shutter_root/share/shutter/resources/icons/sel_window_active.svg",
#~ Gtk2::IconSize->lookup('large-toolbar')
#~ )
#~ );
#~ }
#~ $self->{_awindow} = Gtk2::MenuToolButton->new( $image_awindow, $d->get("Window") );
#~ $self->{_awindow}->set_is_important (TRUE);
#~
#~ $tooltips->set_tip( $self->{_awindow}, $d->get("Capture active window") );
#~ $self->{_awindow}->set_arrow_tooltip( $tooltips, $d->get("Take a screenshot of a specific window"), '' );
#--------------------------------------
#button window
#--------------------------------------
my $image_window;
if($icontheme->has_icon('preferences-system-windows')){
$image_window = Gtk2::Image->new_from_icon_name( 'preferences-system-windows', 'large-toolbar' );
}else{
$image_window = Gtk2::Image->new_from_pixbuf(
Gtk2::Gdk::Pixbuf->new_from_file_at_size(
"$shutter_root/share/shutter/resources/icons/sel_window.svg",
Gtk2::IconSize->lookup('large-toolbar')
)
);
}
$self->{_window} = Gtk2::MenuToolButton->new( $image_window, $d->get("Window") );
$self->{_window}->set_is_important (TRUE);
$tooltips->set_tip( $self->{_window}, $d->get("Select a window with your mouse") );
$self->{_window}->set_arrow_tooltip( $tooltips, $d->get("Take a screenshot of a specific window"), '' );
#button section
#--------------------------------------
my $image_window_sect;
if($icontheme->has_icon('gdm-xnest')){
$image_window_sect = Gtk2::Image->new_from_icon_name( 'gdm-xnest', 'large-toolbar' );
}else{
$image_window_sect = Gtk2::Image->new_from_pixbuf(
Gtk2::Gdk::Pixbuf->new_from_file_at_size(
"$shutter_root/share/shutter/resources/icons/sel_window_section.svg",
Gtk2::IconSize->lookup('large-toolbar')
)
);
}
$self->{_section} = Gtk2::ToolButton->new( $image_window_sect, $d->get("Section") );
$tooltips->set_tip( $self->{_section},
$d->get( "Captures only a section of the window. You will be able to select any child window by moving the mouse over it" ) );
#--------------------------------------
#button menu
#--------------------------------------
my $image_window_menu;
if($icontheme->has_icon('alacarte')){
$image_window_menu = Gtk2::Image->new_from_icon_name( 'alacarte', 'large-toolbar' );
}else{
$image_window_menu = Gtk2::Image->new_from_pixbuf(
Gtk2::Gdk::Pixbuf->new_from_file_at_size(
"$shutter_root/share/shutter/resources/icons/sel_window_menu.svg",
Gtk2::IconSize->lookup('large-toolbar')
)
);
}
$self->{_menu} = Gtk2::ToolButton->new( $image_window_menu, $d->get("Menu") );
$tooltips->set_tip( $self->{_menu},
$d->get( "Select a single menu or cascading menus from any application" ) );
#--------------------------------------
#button tooltip
#--------------------------------------
my $image_window_tooltip;
if($icontheme->has_icon('help-faq')){
$image_window_tooltip = Gtk2::Image->new_from_icon_name( 'help-faq', 'large-toolbar' );
}else{
$image_window_tooltip = Gtk2::Image->new_from_pixbuf(
Gtk2::Gdk::Pixbuf->new_from_file_at_size(
"$shutter_root/share/shutter/resources/icons/sel_window_tooltip.svg",
Gtk2::IconSize->lookup('large-toolbar')
)
);
}
$self->{_tooltip} = Gtk2::ToolButton->new( $image_window_tooltip, $d->get("Tooltip") );
$tooltips->set_tip( $self->{_tooltip},
$d->get( "Capture a tooltip" ) );
#--------------------------------------
#button web
#--------------------------------------
my $image_web;
if($icontheme->has_icon('web-browser')){
$image_web = Gtk2::Image->new_from_icon_name( 'web-browser', 'large-toolbar' );
}else{
$image_web = Gtk2::Image->new_from_pixbuf(
Gtk2::Gdk::Pixbuf->new_from_file_at_size(
"$shutter_root/share/shutter/resources/icons/web_image.svg", Gtk2::IconSize->lookup('large-toolbar')
)
);
}
$self->{_web} = Gtk2::MenuToolButton->new( $image_web, $d->get("Web") );
$tooltips->set_tip( $self->{_web}, $d->get("Take a screenshot of a website") );
$self->{_web}->set_arrow_tooltip( $tooltips, $d->get("Set how long Shutter will wait for the screenshot to complete before aborting the process if it's taking too long"), '' );
#--------------------------------------
#expanding separator
#--------------------------------------
my $expander_r = Gtk2::SeparatorToolItem->new;
$expander_r->set_expand(TRUE);
$expander_r->set_draw(FALSE);
#button edit
#--------------------------------------
my $image_edit;
if($icontheme->has_icon('applications-graphics')){
$image_edit = Gtk2::Image->new_from_icon_name( 'applications-graphics', 'large-toolbar' );
}else{
$image_edit = Gtk2::Image->new_from_pixbuf(
Gtk2::Gdk::Pixbuf->new_from_file_at_size(
"$shutter_root/share/shutter/resources/icons/draw.svg", Gtk2::IconSize->lookup('large-toolbar') )
);
}
$self->{_edit} = Gtk2::ToolButton->new( $image_edit, $d->get("Edit") );
$self->{_edit}->set_is_important (TRUE);
$tooltips->set_tip( $self->{_edit}, $d->get("Use the built-in editor to highlight important fragments of your screenshot or crop it to a desired size") );
#--------------------------------------
#button upload
#--------------------------------------
my $image_upload = Gtk2::Image->new_from_stock( 'gtk-network', 'large-toolbar' );
$self->{_upload} = Gtk2::MenuToolButton->new( $image_upload, $d->get("Export") );
$self->{_upload}->set_is_important (TRUE);
$tooltips->set_tip( $self->{_upload}, $d->get("Upload your images to an image hosting service, FTP site or export them to an arbitrary folder") );
$self->{_upload}->set_arrow_tooltip( $tooltips, $d->get("Show links to previous uploads"), '' );
#--------------------------------------
#create the toolbar
$self->{_toolbar} = Gtk2::Toolbar->new;
$self->{_toolbar}->set_show_arrow(FALSE);
$self->{_toolbar}->insert( $self->{_redoshot}, -1 );
$self->{_toolbar}->insert( Gtk2::SeparatorToolItem->new, -1 );
$self->{_toolbar}->insert( $self->{_select}, -1 );
$self->{_toolbar}->insert( $self->{_full}, -1 );
#~ $self->{_toolbar}->insert( Gtk2::SeparatorToolItem->new, -1 );
#~ $self->{_toolbar}->insert( $self->{_aindow}, -1 );
$self->{_toolbar}->insert( $self->{_window}, -1 );
$self->{_toolbar}->insert( $self->{_section}, -1 );
$self->{_toolbar}->insert( $self->{_menu}, -1 );
$self->{_toolbar}->insert( $self->{_tooltip}, -1 );
#~ $self->{_toolbar}->insert( Gtk2::SeparatorToolItem->new, -1 );
$self->{_toolbar}->insert( $self->{_web}, -1 );
#~ $self->{_toolbar}->insert( Gtk2::SeparatorToolItem->new, -1 );
$self->{_toolbar}->insert( $expander_r, -1 );
$self->{_toolbar}->insert( $self->{_edit}, -1 );
$self->{_toolbar}->insert( $self->{_upload}, -1 );
return $self->{_toolbar};
}
sub create_btoolbar {
my $self = shift;
my $d = $self->{_common}->get_gettext;
my $window = $self->{_common}->get_mainwindow;
my $shutter_root = $self->{_common}->get_root;
#Tooltips
my $tooltips = $self->{_common}->get_tooltips;
#Icontheme
my $icontheme = $self->{_common}->get_theme;
#expanding separator
#--------------------------------------
my $expander_l = Gtk2::SeparatorToolItem->new;
$expander_l->set_expand(TRUE);
$expander_l->set_draw(FALSE);
#--------------------------------------
#button ascending
#--------------------------------------
my $image_sorta = Gtk2::Image->new_from_stock( 'gtk-sort-ascending', 'small-toolbar' );
$self->{_sorta} = Gtk2::ToggleToolButton->new();
$self->{_sorta}->set_icon_widget( $image_sorta );
#--------------------------------------
#button back
#--------------------------------------
my $image_back = Gtk2::Image->new_from_stock( 'gtk-go-back', 'small-toolbar' );
$self->{_back} = Gtk2::ToolButton->new( $image_back, '' );
#--------------------------------------
#button home
#--------------------------------------
my $image_home = Gtk2::Image->new_from_stock( 'gtk-index', 'small-toolbar' );
$self->{_home} = Gtk2::ToolButton->new( $image_home, '' );
#--------------------------------------
#button forward
#--------------------------------------
my $image_forw = Gtk2::Image->new_from_stock( 'gtk-go-forward', 'small-toolbar' );
$self->{_forw} = Gtk2::ToolButton->new( $image_forw, '' );
#--------------------------------------
#button sort descending
#--------------------------------------
my $image_sortd = Gtk2::Image->new_from_stock( 'gtk-sort-descending', 'small-toolbar' );
$self->{_sortd} = Gtk2::ToggleToolButton->new();
$self->{_sortd}->set_icon_widget( $image_sortd );
#--------------------------------------
#expanding separator
#--------------------------------------
my $expander_r = Gtk2::SeparatorToolItem->new;
$expander_r->set_expand(TRUE);
$expander_r->set_draw(FALSE);
#--------------------------------------
#create the toolbar
$self->{_btoolbar} = Gtk2::Toolbar->new;
$self->{_btoolbar}->set_no_show_all(TRUE);
$self->{_btoolbar}->set_show_arrow(FALSE);
$self->{_btoolbar}->set_style('icons');
$self->{_btoolbar}->insert( $expander_l, -1 );
$self->{_btoolbar}->insert( $self->{_sorta}, -1 );
$self->{_btoolbar}->insert( $self->{_back}, -1 );
$self->{_btoolbar}->insert( $self->{_home}, -1 );
$self->{_btoolbar}->insert( $self->{_forw}, -1 );
$self->{_btoolbar}->insert( $self->{_sortd}, -1 );
$self->{_btoolbar}->insert( $expander_r, -1 );
return $self->{_btoolbar};
}
1;
|