* use the screenshot app to take a screenshot

* remove libpng and libz dependency in case we build for Haiku



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27801 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Karsten Heimrich
2008-09-30 21:48:35 +00:00
parent 9ee4aec913
commit eb1466cf86
3 changed files with 37 additions and 11 deletions
+6 -2
View File
@@ -20,6 +20,11 @@ if $(RUN_WITHOUT_APP_SERVER) != 0 {
UsePrivateHeaders [ FDirName kernel ] # For KMessage.h UsePrivateHeaders [ FDirName kernel ] # For KMessage.h
UsePrivateHeaders syslog_daemon ; # For syslog.cpp UsePrivateHeaders syslog_daemon ; # For syslog.cpp
local pngDump ;
if $(TARGET_PLATFORM) != haiku {
pngDump = libpng.so libz.so ;
}
# Build our libbe.so # Build our libbe.so
AddResources libbe.so : libbe_version.rdef ; AddResources libbe.so : libbe_version.rdef ;
@@ -35,7 +40,7 @@ SharedLibrary libbe.so :
libagg.a libagg.a
libroot.so # make sure it links against our libroot.so libroot.so # make sure it links against our libroot.so
libpng.so libz.so # For dumping the screen to PNG in the Interface Kit $(pngDump) # For dumping the screen to PNG in the Interface Kit on R5
$(TARGET_LIBSTDC++) $(TARGET_LIBSTDC++)
; ;
@@ -71,7 +76,6 @@ SharedLibrary libbe_haiku.so :
libbeadapter.so libbeadapter.so
$(TARGET_NETWORK_LIBS) $(TARGET_NETWORK_LIBS)
libpng.so # For dumping the screen to PNG in the Interface Kit
$(TARGET_LIBSTDC++) $(TARGET_LIBSTDC++)
; ;
+10 -2
View File
@@ -26,8 +26,14 @@ if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) {
SetSubDirSupportedPlatforms haiku libbe_test ; SetSubDirSupportedPlatforms haiku libbe_test ;
UsePrivateHeaders app input print interface shared tracker ; UsePrivateHeaders app input print interface shared tracker ;
UseLibraryHeaders icon png zlib ;
local pngDump ;
if $(TARGET_PLATFORM) = haiku {
UseLibraryHeaders icon ;
} else {
pngDump = PNGDump.cpp ;
UseLibraryHeaders icon png zlib ;
}
SEARCH_SOURCE += [ FDirName $(SUBDIR) textview_support ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) textview_support ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) layouter ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) layouter ] ;
@@ -78,7 +84,6 @@ MergeObject <libbe>interface_kit.o :
PictureButton.cpp PictureButton.cpp
PictureDataWriter.cpp PictureDataWriter.cpp
PicturePlayer.cpp PicturePlayer.cpp
PNGDump.cpp
Point.cpp Point.cpp
Polygon.cpp Polygon.cpp
PopUpMenu.cpp PopUpMenu.cpp
@@ -126,6 +131,9 @@ MergeObject <libbe>interface_kit.o :
LayoutOptimizer.cpp LayoutOptimizer.cpp
OneElementLayouter.cpp OneElementLayouter.cpp
SimpleLayouter.cpp SimpleLayouter.cpp
# required on R5
$(pngDump)
; ;
StaticLibrary libcolumnlistview.a : StaticLibrary libcolumnlistview.a :
+17 -3
View File
@@ -44,8 +44,9 @@
#include <tracker_private.h> #include <tracker_private.h>
#include <WindowPrivate.h> #include <WindowPrivate.h>
#include "PNGDump.h" #ifndef __HAIKU__
# include "PNGDump.h"
#endif
//#define DEBUG_WIN //#define DEBUG_WIN
#ifdef DEBUG_WIN #ifdef DEBUG_WIN
@@ -3296,6 +3297,19 @@ BWindow::_HandleKeyDown(BMessage* event)
// Check for Print Screen // Check for Print Screen
int32 rawKey; int32 rawKey;
if (event->FindInt32("key", &rawKey) == B_OK && rawKey == B_PRINT_KEY) { if (event->FindInt32("key", &rawKey) == B_OK && rawKey == B_PRINT_KEY) {
#ifdef __HAIKU__
BMessage message(B_REFS_RECEIVED);
message.AddBool("silent", true);
if ((modifiers & B_CONTROL_KEY) != 0)
message.AddBool("window", true);
if ((modifiers & B_SHIFT_KEY) != 0 || (modifiers & B_OPTION_KEY) != 0)
message.ReplaceBool("silent", false);
be_roster->Launch("application/x-vnd.haiku-screenshot", &message);
return true;
#elif
// Get filename // Get filename
BPath homePath; BPath homePath;
@@ -3328,7 +3342,7 @@ BWindow::_HandleKeyDown(BMessage* event)
// Free the bitmap allocated by BScreen.GetBitmap // Free the bitmap allocated by BScreen.GetBitmap
delete screenDump; delete screenDump;
#endif
return true; return true;
} }
} }