incubator-celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abroekh...@apache.org
Subject svn commit: r1414688 - in /incubator/celix/trunk: examples/hello_world/ examples/osgi-in-action/chapter04-paint-example/paint/private/include/ examples/osgi-in-action/chapter04-paint-example/paint/private/src/ framework/ shell/ shell_tui/
Date Wed, 28 Nov 2012 13:52:51 GMT
Author: abroekhuis
Date: Wed Nov 28 13:52:49 2012
New Revision: 1414688

URL: http://svn.apache.org/viewvc?rev=1414688&view=rev
Log:
CELIX-42: Small changes due to windows support

Modified:
    incubator/celix/trunk/examples/hello_world/CMakeLists.txt
    incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/include/paint_frame.h
    incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c
    incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c
    incubator/celix/trunk/framework/CMakeLists.txt
    incubator/celix/trunk/shell/CMakeLists.txt
    incubator/celix/trunk/shell_tui/CMakeLists.txt

Modified: incubator/celix/trunk/examples/hello_world/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/hello_world/CMakeLists.txt?rev=1414688&r1=1414687&r2=1414688&view=diff
==============================================================================
--- incubator/celix/trunk/examples/hello_world/CMakeLists.txt (original)
+++ incubator/celix/trunk/examples/hello_world/CMakeLists.txt Wed Nov 28 13:52:49 2012
@@ -20,4 +20,4 @@ SET_HEADERS("Bundle-Name: Apache Celix S
 	
 bundle(hello_world SOURCES private/src/activator)
 include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
-target_link_libraries(hello_world celix_framework)
+target_link_libraries(hello_world celix_framework)
\ No newline at end of file

Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/include/paint_frame.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/include/paint_frame.h?rev=1414688&r1=1414687&r2=1414688&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/include/paint_frame.h
(original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/include/paint_frame.h
Wed Nov 28 13:52:49 2012
@@ -43,6 +43,7 @@ struct paint_frame {
 	LINKED_LIST m_shapeComponents;
 	bundle_context_t context;
 	GThread *main;
+	char *file;
 };
 
 

Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c?rev=1414688&r1=1414687&r2=1414688&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c
(original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c
Wed Nov 28 13:52:49 2012
@@ -55,7 +55,7 @@ typedef struct paintFrameActivatorData *
 celix_status_t bundleActivator_create(bundle_context_t context, void **userData) {
 	apr_pool_t *pool;
 	GREETING_ACTIVATOR activator;
-	service_tracker_customizer_t cust;
+	service_tracker_customizer_t cust = NULL;
 	printf("Paint_frame create\n");
 	celix_status_t status = bundleContext_getMemoryPool(context, &pool);
 	if (status == CELIX_SUCCESS) {

Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c?rev=1414688&r1=1414687&r2=1414688&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c
(original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c
Wed Nov 28 13:52:49 2012
@@ -84,7 +84,6 @@ celix_status_t paintFrame_create(bundle_
 		status = CELIX_ENOMEM;
 	} else {
 		*frame = this;
-		GtkBuilder *builder;
 		char *builderFile;
 		BUNDLE bundle;
 		GError *error = NULL;
@@ -103,33 +102,14 @@ celix_status_t paintFrame_create(bundle_
 		if (status == CELIX_SUCCESS) {
 			status = bundle_getEntry(bundle, "gtktest.glade", mypool, &builderFile);
 			if (status == CELIX_SUCCESS) {
-				g_thread_init(NULL);
+				(*frame)->file = builderFile;
+
 				gdk_threads_init();
 				gtk_init(NULL, NULL);
 
-				builder = gtk_builder_new();
-				gtk_builder_add_from_file(builder, builderFile, NULL);
-
-				(*frame)->window = GTK_WIDGET(gtk_builder_get_object (builder, "window1"));
-				(*frame)->toolbar = GTK_WIDGET(gtk_builder_get_object (builder, "toolbar1"));
-				(*frame)->drawingArea = GTK_WIDGET(gtk_builder_get_object (builder, "drawingarea1"));
-				g_object_unref(G_OBJECT(builder));
-
-				gtk_window_set_title(GTK_WINDOW((*frame)->window), "OSGi in Action, Paint-Example");
-
-				gtk_widget_set_events ((*frame)->drawingArea, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK);
-
-				g_signal_connect(G_OBJECT((*frame)->window), "destroy", G_CALLBACK(paintFrame_destroy),
(*frame));
-				g_signal_connect(G_OBJECT((*frame)->drawingArea), "expose_event", G_CALLBACK(paintFrame_expose),
(*frame));
-				g_signal_connect(G_OBJECT((*frame)->drawingArea), "configure_event", G_CALLBACK(paintFrame_configure),
(*frame));
-				g_signal_connect(G_OBJECT((*frame)->drawingArea), "button_press_event", G_CALLBACK(paintFrame_mousePressed),
(*frame));
-
-
-				paintFrame_show((*frame));
-				(*frame)->showing = true;
-
 				if( g_thread_supported()) {
-					(*frame)->main = g_thread_create(paintFrame_gtkmain, (*frame), TRUE, &error);
+					(*frame)->main = g_thread_new("main", paintFrame_gtkmain, (*frame));
+					// (*frame)->main = g_thread_create(paintFrame_gtkmain, (*frame), TRUE, &error);
 					if ((*frame)->main == NULL){
 						g_printerr ("Failed to create thread: %s\n", error->message);
 						status = CELIX_BUNDLE_EXCEPTION;
@@ -345,7 +325,31 @@ static celix_status_t paintFrame_redraw(
 }
 
 static gpointer paintFrame_gtkmain(gpointer a_data) {
+	GtkBuilder *builder;
+	PAINT_FRAME frame = (PAINT_FRAME) a_data;
+
 	gdk_threads_enter();
+	builder = gtk_builder_new();
+	gtk_builder_add_from_file(builder, frame->file, NULL);
+
+	frame->window = GTK_WIDGET(gtk_builder_get_object (builder, "window1"));
+	frame->toolbar = GTK_WIDGET(gtk_builder_get_object (builder, "toolbar1"));
+	frame->drawingArea = GTK_WIDGET(gtk_builder_get_object (builder, "drawingarea1"));
+	g_object_unref(G_OBJECT(builder));
+
+	gtk_window_set_title(GTK_WINDOW(frame->window), "OSGi in Action, Paint-Example");
+
+	gtk_widget_set_events (frame->drawingArea, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK);
+
+	g_signal_connect(G_OBJECT(frame->window), "destroy", G_CALLBACK(paintFrame_destroy),
frame);
+	g_signal_connect(G_OBJECT(frame->drawingArea), "expose_event", G_CALLBACK(paintFrame_expose),
frame);
+	g_signal_connect(G_OBJECT(frame->drawingArea), "configure_event", G_CALLBACK(paintFrame_configure),
frame);
+	g_signal_connect(G_OBJECT(frame->drawingArea), "button_press_event", G_CALLBACK(paintFrame_mousePressed),
frame);
+
+
+	paintFrame_show(frame);
+	frame->showing = true;
+
 	gtk_main();
 	gdk_threads_leave();
 

Modified: incubator/celix/trunk/framework/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/CMakeLists.txt?rev=1414688&r1=1414687&r2=1414688&view=diff
==============================================================================
--- incubator/celix/trunk/framework/CMakeLists.txt (original)
+++ incubator/celix/trunk/framework/CMakeLists.txt Wed Nov 28 13:52:49 2012
@@ -19,25 +19,21 @@ celix_subproject(FRAMEWORK "Option to bu
 if (FRAMEWORK) 
     cmake_minimum_required(VERSION 2.6)
     
-    find_package(CURL REQUIRED)
     find_package(ZLIB REQUIRED)
     
-    #include(CPackComponent)
+    include(CPackComponent)
     
-    #cpack_add_component(framework
-    #	DISPLAY_NAME Framework
-    #    DESCRIPTION "The Apache Celix framework library"
-    #    REQUIRED
-    #)
+    cpack_add_component(framework
+    	DISPLAY_NAME Framework
+        DESCRIPTION "The Apache Celix framework library"
+        REQUIRED
+    )
     
     add_definitions(-DUSE_FILE32API)
-    #aux_source_directory("private/src" SRC)
-    #include_directories(${CURL_INCLUDE_DIR})
     include_directories(${ZLIB_INCLUDE_DIR})
     include_directories("private/include")
     include_directories("public/include")
     include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
-	#message("Source: ${SRC}")
 
 	if(WIN32)
 	  set(IO private/src/iowin32.c)

Modified: incubator/celix/trunk/shell/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/shell/CMakeLists.txt?rev=1414688&r1=1414687&r2=1414688&view=diff
==============================================================================
--- incubator/celix/trunk/shell/CMakeLists.txt (original)
+++ incubator/celix/trunk/shell/CMakeLists.txt Wed Nov 28 13:52:49 2012
@@ -39,9 +39,9 @@ if (SHELL)
 	include_directories(${CURL_INCLUDE_DIRS})
     target_link_libraries(shell celix_framework ${CURL_LIBRARIES})
     
-    #package(shell FILES public/include/shell.h public/include/command.h public/include/command_private.h)
+    package(shell FILES public/include/shell.h public/include/command.h public/include/command_private.h)
     
-    #FILE(GLOB files public/include/shell.h public/include/command.h public/include/command_private.h)
-    #INSTALL(FILES ${files} DESTINATION include/celix/shell COMPONENT framework)
-    #INSTALL(FILES ${PROJECT_BINARY_DIR}/bundles/shell.zip DESTINATION share/celix/bundles
COMPONENT framework)
+    FILE(GLOB files public/include/shell.h public/include/command.h public/include/command_private.h)
+    INSTALL(FILES ${files} DESTINATION include/celix/shell COMPONENT framework)
+    INSTALL(FILES ${PROJECT_BINARY_DIR}/bundles/shell.zip DESTINATION share/celix/bundles
COMPONENT framework)
 endif (SHELL)
\ No newline at end of file

Modified: incubator/celix/trunk/shell_tui/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/shell_tui/CMakeLists.txt?rev=1414688&r1=1414687&r2=1414688&view=diff
==============================================================================
--- incubator/celix/trunk/shell_tui/CMakeLists.txt (original)
+++ incubator/celix/trunk/shell_tui/CMakeLists.txt Wed Nov 28 13:52:49 2012
@@ -25,7 +25,7 @@ if (SHELL_TUI)
     include_directories("${PROJECT_SOURCE_DIR}/shell/public/include")
     target_link_libraries(shell_tui celix_framework)
     
-    #package(shell_tui)
+    package(shell_tui)
     
-    #INSTALL(FILES ${PROJECT_BINARY_DIR}/bundles/shell_tui.zip DESTINATION share/celix/bundles
COMPONENT framework)
+    INSTALL(FILES ${PROJECT_BINARY_DIR}/bundles/shell_tui.zip DESTINATION share/celix/bundles
COMPONENT framework)
 endif (SHELL_TUI)
\ No newline at end of file



Mime
View raw message