From 307a3dd1d885eacf1d910d04505f7b9f404dac53 Mon Sep 17 00:00:00 2001 From: Bastian Wissler Date: Thu, 11 Jun 2009 12:34:28 +0000 Subject: vmchooser: * Now supports reading from /etc/opt/openslx/vmchooser-stage3.conf for the xml filter path * new binary included * changed make system to CMake to support better platform specific handling -> in the past different boost libraries had to be changed in the makefile * Closes Feature Request #429 git-svn-id: http://svn.openslx.org/svn/openslx/openslx-src-tools/vmchooser/trunk@2947 95ad53e4-c205-0410-b2fa-d234c58c8868 --- README | 46 ++-- build/make.sh | 7 + vmchooser/CMakeLists.txt | 41 ++++ vmchooser/Doxyfile | 394 +++++++++++++++-------------------- vmchooser/Makefile | 39 ---- vmchooser/SWindow.cxx | 48 ++--- vmchooser/SessChoo.kdevelop.filelist | 11 - vmchooser/SessChoo.kdevelop.pcs | Bin 132746 -> 0 bytes vmchooser/SessChoo.kdevses | 34 --- vmchooser/main.cxx | 61 ++++-- vmchooser/runImage.cxx | 2 +- vmchooser/vmchooser.kdevelop | 227 -------------------- 12 files changed, 316 insertions(+), 594 deletions(-) create mode 100755 build/make.sh create mode 100644 vmchooser/CMakeLists.txt delete mode 100644 vmchooser/Makefile delete mode 100644 vmchooser/SessChoo.kdevelop.filelist delete mode 100644 vmchooser/SessChoo.kdevelop.pcs delete mode 100644 vmchooser/SessChoo.kdevses delete mode 100644 vmchooser/vmchooser.kdevelop diff --git a/README b/README index 45a2068..be2de8f 100644 --- a/README +++ b/README @@ -17,10 +17,15 @@ What does it do? If chosen, it starts the proper virtualizer script or the linux session as a background process and terminates itself. +How can I build it? + This project has been converted to cmake and can be built by + "cmake && make". With cmake, this can be built + in an arbitrary directory. + + UPDATE: You can build it by changing into the directory "build", calling "./make.sh" + How can I install it? - Type "make install" in the vmchooser Folder and it gets installed - in the right folder (if you have the whole svn structure locally). - Then you have to install the "vmchooser"-plugin to your VendorOS. + See below What command-line parameters are available? "-p|--path=" In this (abolute) path are your xml-files for the virtualizer-plugin @@ -35,18 +40,31 @@ You just need to compile this, if you have local changes. The most recent svn version is also included in binary format in the main folder of this openslx-distribution. -Enter "make" to compile everything. -Enter "make install" to install it to the proper path -of the svn distribution of openslx. Do not forget to -enter "make install" in openslx/trunk . +Enter "cmake && make" to compile everything. + +UPDATE: There is a script in the build-directory to simplify building. + +Enter "cp vmchooser ../../../../openslx/trunk/os-plugins/plugins/vmchooser/files/" +to install it to the proper path of the svn distribution of openslx +(only if the build-path is [SVN ROOT]/openslx-src-tools/vmchooser/trunk/somefolder/). + +Do not forget to enter "make install" in [SVN ROOT]/openslx/trunk . Needed libraries to compile: - All sorts of X libs and development files - - fltk-2 (see note *) - - libxml2 (libxml2-dev on Ubuntu) - - libboost-regex_s (static - - a dynamic version can be enabled by changing the Makefile) - (libboost-dev/libboost-regex-dev on Ubuntu) + - fltk-2 (included - see note *) + - libxml2 (included - libxml2-dev on Ubuntu) + + * Boost Libraries (static - dynamic versions can + be enabled by changing the CMakelists.txt - + specifically commenting out the + Boost_USE_STATIC_LIBS variable definition) + (libboost-dev/libboost-[regex|filesystem|system]-dev on Ubuntu) + - libboost-regex_s + - libboost_filesystem_s + - libboost_system_s + +Most probably (for fltk2-includes): - libpng-dev (libpng12-dev on Ubuntu) - libjpeg-dev (libjpeg-dev on Ubuntu) - libxi-dev (libxi-dev on Ubuntu) @@ -60,8 +78,8 @@ Needed libraries to run: - libxml2 =================================== -* Some static libraries of fltk-2 - svn version - are located -in fltk-2/ and could be used to link against this program. +* Some static libraries of fltk - svn version - and libxml2 are located +in fltk/ and libxml2/ and are used to link against this program. - as images are enabled, you should have libjpeg and libpng too. =================================== diff --git a/build/make.sh b/build/make.sh new file mode 100755 index 0000000..9888f1e --- /dev/null +++ b/build/make.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# call cmake with right folder +cmake ../vmchooser/ + +# call GNU make +make diff --git a/vmchooser/CMakeLists.txt b/vmchooser/CMakeLists.txt new file mode 100644 index 0000000..6082824 --- /dev/null +++ b/vmchooser/CMakeLists.txt @@ -0,0 +1,41 @@ + +cmake_minimum_required(VERSION 2.6) +project(vmchooser) + +set(CMAKE_BUILD_TYPE Debug) + +#set(CMAKE_VERBOSE_MAKEFILE ON) +set(OPENSLX_ROOT "../../../..") +#set(OPENSLX_ROOT "~/hiwi/openslx") + +file(GLOB VMCHOOSER_SOURCES *.cxx) + +set(Boost_USE_STATIC_LIBS ON) +find_package( Boost COMPONENTS "filesystem" "regex" "system" ) + +if(Boost_FOUND) + link_directories(${Boost_LIBRARY_DIRS}) + include_directories(${Boost_INCLUDE_DIRS}) +endif() + + +include_directories(. ../fltk/ ../libxml2/include) + +add_executable(vmchooser ${VMCHOOSER_SOURCES}) + + +add_library(fltk2 STATIC IMPORTED) +add_library(fltk2_images STATIC IMPORTED) +add_library(xml2 STATIC IMPORTED) + +set_property(TARGET fltk2 PROPERTY IMPORTED_LOCATION "../fltk/lib/libfltk2.a") +set_property(TARGET fltk2_images PROPERTY IMPORTED_LOCATION "../fltk/lib/libfltk2_images.a") +set_property(TARGET xml2 PROPERTY IMPORTED_LOCATION "../libxml2/libs/libxml2.a") + + +#message(STATUS "Boost_LIBRARIES=${Boost_LIBRARIES}") +target_link_libraries(vmchooser fltk2 fltk2_images xml2 + Xi Xinerama X11 Xft ${Boost_LIBRARIES}) + +install(TARGETS vmchooser RUNTIME DESTINATION + "${OPENSLX_ROOT}/openslx/trunk/os-plugins/plugins/vmchooser/files/") \ No newline at end of file diff --git a/vmchooser/Doxyfile b/vmchooser/Doxyfile index 3c5258c..8f0ee49 100644 --- a/vmchooser/Doxyfile +++ b/vmchooser/Doxyfile @@ -3,281 +3,223 @@ #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- -PROJECT_NAME = SessChoo -PROJECT_NUMBER = 1 -OUTPUT_DIRECTORY = -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = /home/bastian/studium/hiwi/fltk-2/SessChoo/ -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO +PROJECT_NAME = vmchooser +PROJECT_NUMBER = 0.0.0.1 +OUTPUT_DIRECTORY = +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" "The $name widget" "The $name file" is provides specifies contains represents a an the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = /home/bastian/studium/hiwi/fltk-2/SessChoo/ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -BUILTIN_STL_SUPPORT = NO -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- -EXTRACT_ALL = NO -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = NO -FILE_VERSION_FILTER = +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST = YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = /home/bastian/studium/hiwi/fltk-2/SessChoo -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.py \ - *.C \ - *.CC \ - *.C++ \ - *.II \ - *.I++ \ - *.H \ - *.HH \ - *.H++ \ - *.CS \ - *.PHP \ - *.PHP3 \ - *.M \ - *.MM \ - *.PY \ - *.C \ - *.H \ - *.tlh \ - *.diff \ - *.patch \ - *.moc \ - *.xpm \ - *.dox -RECURSIVE = yes -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = * -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO +INPUT = . +FILE_PATTERNS = *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py *.C *.CC *.C++ *.II *.I++ *.H *.HH *.H++ *.CS *.PHP *.PHP3 *.M *.MM *.PY *.C *.H *.tlh *.diff *.patch *.moc *.xpm *.dox +RECURSIVE = yes +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES +REFERENCES_RELATION = YES REFERENCES_LINK_SOURCE = YES -USE_HTAGS = NO -VERBATIM_HEADERS = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- -GENERATE_LATEX = YES -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- -GENERATE_XML = yes -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES +GENERATE_XML = yes +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO +GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = SessChoo.tag -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl +TAGFILES = +GENERATE_TAGFILE = SessChoo.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -CALLER_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 1000 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- -SEARCHENGINE = NO +SEARCHENGINE = NO diff --git a/vmchooser/Makefile b/vmchooser/Makefile deleted file mode 100644 index a44aa19..0000000 --- a/vmchooser/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -TARGET := vmchooser -SRCS := $(wildcard *.cxx) -OBJS := ${SRCS:.cxx=.o} -DEPS := ${SRCS:.cxx=.dep} -XDEPS := $(wildcard ${DEPS}) - -CC = g++ -DEBUG_CCFLAGS = -O0 -Wall -I/usr/include -I../fltk/ -I. -I../libxml2/include -ggdb #-ggdb #-Werror -CCFLAGS = -O2 -Wall -I/usr/include -I../fltk/ -I. -I../libxml2/include/ -LDFLAGS = -L/usr/lib -LIBS = -lpng ../fltk/lib/libfltk2_images.a -ljpeg -lz -lXi -lXinerama -lpthread -lm -lXext -lsupc++ -lXrender -lfontconfig -lXft -lXdmcp -lXau -ldl -lz -lfreetype -lX11 ../libxml2/libs/libxml2.a ../fltk/lib/libfltk2.a /usr/lib/libboost_regex-s.a /usr/lib/libboost_filesystem-s.a /usr/lib/libboost_system-s.a - -.PHONY: all clean distclean -all:: ${TARGET} - -ifneq (${XDEPS},) -include ${XDEPS} -endif - -${TARGET}: ${OBJS} - ${CC} ${LDFLAGS} -o $@ $^ ${LIBS} - strip $@ - -debug: ${OBJS} - ${CC} ${LDFLAGS} -o vmchooserdbg $^ ${LIBS} - -${OBJS}: %.o: %.cxx %.dep - ${CC} ${CCFLAGS} -o $@ -c $< - -${DEPS}: %.dep: %.cxx Makefile - ${CC} ${CCFLAGS} -MM $< > $@ - -clean:: - rm -f *~ *.o ${TARGET} vmchooserdbg - -install: - cp vmchooser ../../../../openslx/trunk/os-plugins/plugins/vmchooser/files/ - -distclean:: clean diff --git a/vmchooser/SWindow.cxx b/vmchooser/SWindow.cxx index 97a964b..278fbfb 100644 --- a/vmchooser/SWindow.cxx +++ b/vmchooser/SWindow.cxx @@ -7,12 +7,12 @@ #include -#include -#include -#include -#include -#include -#include +#include "img/gnome_32.xpm" +#include "img/kde_32.xpm" +#include "img/linux_32.xpm" +#include "img/xp_32.xpm" +#include "img/xp_locked_32.xpm" +#include "img/xfce_32.xpm" using namespace fltk; @@ -37,35 +37,35 @@ SWindow::SWindow(int w, int h, char* p) add(go); width = w; height = h; - + border(false); go.callback(cb_return,this); sel.callback(cb_select, this); exit_btn.callback(cb_exit, this); - + Style* btn_style = new Style(*fltk::ReturnButton::default_style); Style* sel_style = new Style(*fltk::Browser::default_style); - - - + + + Font* f1 = font("sans"); //Font* f1bold = f1->bold(); - + btn_style->textsize(16); btn_style->labelsize(16); btn_style->labelfont(f1); btn_style->textfont(f1); - + sel_style->textfont(f1); sel_style->textsize(16); - + exit_btn.style(btn_style); go.style(btn_style); sel.style(sel_style); - + const int widths[] = { -1,-1,-1,-1, 0 }; sel.column_widths(widths); - + end(); sel.take_focus(); }; @@ -80,7 +80,7 @@ void SWindow::cb_return() { //if(!sel.item()) return; //curr = (Item*) sel.item(); - + if(curr != 0 && curr->user_data()) { DataEntry* dat = (DataEntry*) curr->user_data(); cout << dat->short_description << endl; @@ -141,7 +141,7 @@ void SWindow::set_lin_entries(DataEntry** ent) ((Widget*) w)->image(xpm); w->tooltip(it->second->description.c_str()); w->callback(&runImage, (void*)it->second); - + } lin_entgroup->end(); } @@ -154,20 +154,20 @@ void SWindow::set_entries(DataEntry** ent) { this->ent = ent; sort_entries(); - + entgroup = (ItemGroup*)sel.add_group("VMWARE SESSIONS", &sel); for (int i=0; ent[i] != '\0'; i++) { Item* w= (Item*)sel.add_leaf(ent[i]->short_description.c_str(), entgroup, (void*)ent[i] ); - + xpmImage* xpm = new xpmImage(get_symbol(ent[i])); ((Widget*) w)->image(xpm); w->tooltip(ent[i]->description.c_str()); w->callback(&runImage, (void*)ent[i]); - + } entgroup->end(); - + } /************************************************************** @@ -224,7 +224,7 @@ void SWindow::unfold_entries(bool lin_entries, bool vm_entries) { } else { sel.goto_index(0); Item* it = (Item*) sel.next(); - + while( it ) { if(! strcmp(prename,it->label()) ) { sel.select_only_this(0); @@ -275,7 +275,7 @@ void SWindow::sort_entries() { return; } DataEntry* ptr; - + // worst case sort - but it is enough for this few entries for(int i=0; ent[i] != '\0'; i++) { for(int j=0; ent[j] != '\0'; j++) { diff --git a/vmchooser/SessChoo.kdevelop.filelist b/vmchooser/SessChoo.kdevelop.filelist deleted file mode 100644 index db31ace..0000000 --- a/vmchooser/SessChoo.kdevelop.filelist +++ /dev/null @@ -1,11 +0,0 @@ -# KDevelop Custom Project File List -Makefile -SWindow.cxx -inc -inc/DataEntry.h -inc/SWindow.h -inc/functions.h -main.cxx -readLinSess.cxx -readXmlDir.cxx -runImage.cxx diff --git a/vmchooser/SessChoo.kdevelop.pcs b/vmchooser/SessChoo.kdevelop.pcs deleted file mode 100644 index 006c1c2..0000000 Binary files a/vmchooser/SessChoo.kdevelop.pcs and /dev/null differ diff --git a/vmchooser/SessChoo.kdevses b/vmchooser/SessChoo.kdevses deleted file mode 100644 index fb9bd17..0000000 --- a/vmchooser/SessChoo.kdevses +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vmchooser/main.cxx b/vmchooser/main.cxx index b266333..09d382c 100644 --- a/vmchooser/main.cxx +++ b/vmchooser/main.cxx @@ -34,10 +34,10 @@ int main(int argc, char** argv) { char* xmlpath = NULL; char* lsesspath = NULL; int width=0, height=0; - + //opt->setVerbose(); opt->autoUsagePrint(false); - + opt->addUsage(""); opt->addUsage("SessionChooser Usage: vmchooser [OPTS|image.xml]"); opt->addUsage("\t{-p |--path=} path to vmware (.xml) files"); @@ -47,25 +47,50 @@ int main(int argc, char** argv) { opt->addUsage("\t{-h |--help} prints help"); opt->addUsage(""); opt->addUsage("Run with xml-file as additional argument to start image at once."); - + opt->setFlag("help",'h'); opt->setFlag("version",'v'); opt->setOption("path", 'p'); opt->setOption("lpath", 'l'); opt->setOption("size",'s'); - + opt->processCommandArgs(argc, argv); - + /** HELP */ if(opt->getFlag("help") || opt->getFlag('h')) { opt->printUsage(); return 0; } - - /** XML - PATH */ + + /** XML - PATH + * + * 1. read from stage3.conf + * 2. option -p + * 3. option --path + * 4. default value "/var/lib/virt/vmware/" + * + **/ + + ifstream ifs ( "/etc/opt/openslx/vmchooser-stage3.conf" , ifstream::in ); + if(ifs) { + int n = 255; + char buf[n]; + string s = ""; + while(!ifs.eof()) { + ifs.getline(buf, n); + s = buf; + if(s.substr(0,17) == "vmchooser_xmlpath") { + xmlpath = new char[strlen(buf)]; + xmlpath = (char*)s.substr(19,s.length()-20).append("/").c_str(); + } + } + + } + if(opt->getValue('p')!=NULL) { xmlpath = opt->getValue('p'); } + if(opt->getValue("path")!= NULL) { xmlpath = opt->getValue("path"); } @@ -74,7 +99,7 @@ int main(int argc, char** argv) { // Default Path comes here xmlpath = (char *) "/var/lib/virt/vmware/"; } - + /* VERSION */ if(opt->getFlag('v') || opt->getFlag("version")) { // just print out version information - helps testing @@ -83,7 +108,7 @@ int main(int argc, char** argv) { return 0; } - + /** LINUX SESSION PATH */ if(opt->getValue('l')!=NULL) { lsesspath = opt->getValue('l'); @@ -94,18 +119,18 @@ int main(int argc, char** argv) { if (lsesspath == NULL) { lsesspath = (char *) "/usr/share/xsessions/"; } - + /** Size of Window */ string size; unsigned int i; - + if(opt->getValue('s')!=NULL) { size = opt->getValue('s'); } if(opt->getValue("size")!= NULL) { size = opt->getValue("size"); } - + if (size.empty()) { width = 500; height = 550; @@ -133,7 +158,7 @@ int main(int argc, char** argv) { DataEntry* result = get_entry(doc); runImage(*result, opt->getArgv(0)); } - + delete opt; @@ -141,8 +166,8 @@ int main(int argc, char** argv) { DataEntry** sessions = NULL; DataEntry** lsessions = NULL; sessions = readXmlDir(xmlpath); - lsessions = readLinSess(lsesspath); - + lsessions = readLinSess(lsesspath); + SWindow& win = *SWindow::getInstance(width, height); mainwin = &win; bool lin_entries=false; @@ -156,15 +181,15 @@ int main(int argc, char** argv) { win.set_entries(sessions); vm_entries = true; } - + win.unfold_entries(lin_entries, vm_entries); win.show(); // argc,argv win.border(false); bool retval = run(); - + win.free_entries(); - + return retval; } diff --git a/vmchooser/runImage.cxx b/vmchooser/runImage.cxx index a5363ca..21ac50d 100644 --- a/vmchooser/runImage.cxx +++ b/vmchooser/runImage.cxx @@ -45,7 +45,7 @@ void runImage(fltk::Widget*, void* p) strncpy(arg1, (char*) string("'\n\nStarte Image: ") .append(dat.short_description) .append("\n'").c_str(),MAX_LENGTH); - char* argv[] = { "/opt/openslx/plugin-repo/vmchooser/mesgdisp", + char* argv[] = { (char*) "/opt/openslx/plugin-repo/vmchooser/mesgdisp", arg1, NULL }; printf("%s", arg1); diff --git a/vmchooser/vmchooser.kdevelop b/vmchooser/vmchooser.kdevelop deleted file mode 100644 index 53bf885..0000000 --- a/vmchooser/vmchooser.kdevelop +++ /dev/null @@ -1,227 +0,0 @@ - - - - Bastian Wissler - bw21@mars.uni-freiburg.de - 1 - KDevCustomProject - C++ - - vmchooser - ./ - false - - - - - - - executable - /home/bastian/studium/hiwi/openslx/openslx-src-tools/trunk/os-plugins/plugins/vmchooser/vmchooser - - - /home/bastian/studium/hiwi/openslx/openslx-src-tools/trunk/os-plugins/plugins/vmchooser - false - false - false - false - false - - - - *.java - *.h - *.H - *.hh - *.hxx - *.hpp - *.c - *.C - *.cc - *.cpp - *.c++ - *.cxx - Makefile - CMakeLists.txt - - - - make - - - - 0 - - - - default - - - - - - false - 0 - 0 - false - - - - default - - - - - - - - - - - - - true - false - false - false - - - false - true - 10 - - - - - ada - ada_bugs_gcc - bash - bash_bugs - clanlib - fortran_bugs_gcc - gnome1 - gnustep - gtk - gtk_bugs - haskell - haskell_bugs_ghc - java_bugs_gcc - java_bugs_sun - kde2book - opengl - pascal_bugs_fp - php - php_bugs - perl - perl_bugs - python - python_bugs - qt-kdev3 - ruby - ruby_bugs - sdl - sw - w3c-dom-level2-html - w3c-svg - w3c-uaag10 - wxwidgets_bugs - - - Guide to the Qt Translation Tools - Qt Assistant Manual - Qt Designer Manual - Qt Reference Documentation - qmake User Guide - - - KDE Libraries (Doxygen) - - - - - - - - - - - - - false - 3 - 3 - /usr/qt/3 - EmbeddedKDevDesigner - /usr/qt/3/bin/qmake - /usr/qt/3/bin/designer - - - - false - true - true - 250 - 400 - 250 - false - 0 - true - true - false - std=_GLIBCXX_STD;__gnu_cxx=std - true - false - true - true - false - true - true - false - .; - - - - set - m_,_ - theValue - true - true - - - false - true - Vertical - - - automatic_%2Fhome%2Fbastian%2Fstudium%2Fhiwi%2Fopenslx%2Fopenslx-src-tools%2Ftrunk%2Fos-plugins%2Fplugins%2Fvmchooser%2Fvmchooser - - - - - .h - .cxx - - - - - /home/bastian/studium/hiwi/openslx/openslx-src-tools/trunk/os-plugins/plugin/vmchooser/tags - - - - - - - - - - - - *.o,*.lo,CVS - false - - - false - false - - - -- cgit v1.2.3-55-g7522