Permalink
Browse files

Merge remote-tracking branch 'origin/testwin32gtk2'

Conflicts:
	src/gtk-hl-assistant.f90
	src/gtk-hl-chooser.f90
	src/gtk-hl-container.f90
	src/gtk-hl-dialog.f90
	src/gtk-hl-misc.f90
	src/gtk-hl-spin-slider.f90
  • Loading branch information...
Jens Hunger
Jens Hunger committed Jun 14, 2013
2 parents 5d02ea1 + 600055d commit a17736bc8d61488fb4f06f714ceeef5507aa4cc3
View
@@ -22,7 +22,7 @@
#
# Contributed by Kyle Horne: 05.11.2011
# Tests redesigned, James Tappin 05/17/2011
-# Last modifications, James Tappin: 01/21/2013
+# Last modifications: Jens Hunger: 03/05/2013
# CMAKE build file for GtkFortran
@@ -52,15 +52,20 @@ if (NOT NO_BUILD_EXAMPLES)
target_link_libraries(gtkhello2 gtk-fortran_static ${GTK_LIBRARIES})
add_test(gtkhello2 ./gtkhello2)
- # This command is for Unix/Linux, please add a windows equivalent in an
- # Else section
if (UNIX)
add_custom_command(
OUTPUT gtkbuilder.glade
COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/gtkbuilder.glade ${CMAKE_CURRENT_BINARY_DIR}/gtkbuilder.glade
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gtkbuilder.glade
)
endif()
+ if (CMAKE_HOST_WIN32)
+ add_custom_command(
+ OUTPUT gtkbuilder.glade
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/gtkbuilder.glade ${CMAKE_CURRENT_BINARY_DIR}/gtkbuilder.glade
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gtkbuilder.glade
+ )
+ endif()
add_custom_target(glade ALL DEPENDS "gtkbuilder.glade")
View
@@ -48,7 +48,7 @@ module handlers
& gtk_about_dialog_set_website, gtk_button_new, gtk_button_new_with_label, &
& gtk_container_add, gtk_container_set_border_width, gtk_dialog_run, gtk_drawing_area_new,&
& gtk_entry_get_text, gtk_entry_new, gtk_file_chooser_button_new, &
- & gtk_file_chooser_get_file, gtk_file_chooser_get_filename, gtk_label_new, gtk_main, &
+ & gtk_file_chooser_get_file, gtk_label_new, gtk_main, &
& gtk_main_quit, gtk_progress_bar_new, gtk_progress_bar_pulse, &
& gtk_progress_bar_set_fraction, gtk_progress_bar_set_text, gtk_scrolled_window_new,&
& gtk_table_attach, gtk_table_attach_defaults, gtk_table_new, gtk_text_buffer_set_text,&
@@ -63,6 +63,8 @@ module handlers
use gdk, only: gdk_cairo_create, gdk_cairo_set_source_pixbuf
use gdk_pixbuf, only: gdk_pixbuf_get_has_alpha, gdk_pixbuf_get_n_channels, &
& gdk_pixbuf_get_pixels, gdk_pixbuf_get_rowstride, gdk_pixbuf_new
+
+ use gtk_os_dependent, only: gtk_file_chooser_get_filename
use my_widgets
implicit none
View
@@ -52,6 +52,7 @@ module handlers
! X Window system. Then callback functions must have an event argument:
function delete_event (widget, event, gdata) result(ret) bind(c)
use iso_c_binding, only: c_ptr, c_int
+ !GCC$ ATTRIBUTES DLLEXPORT :: delete_event
integer(c_int) :: ret
type(c_ptr), value :: widget, event, gdata
print *, "my delete_event"
@@ -61,6 +62,7 @@ end function delete_event
! "destroy" is a GtkObject signal
subroutine destroy (widget, gdata) bind(c)
use iso_c_binding, only: c_ptr
+ !GCC$ ATTRIBUTES DLLEXPORT :: destroy
type(c_ptr), value :: widget, gdata
print *, "my destroy"
call gtk_main_quit ()
@@ -69,6 +71,7 @@ end subroutine destroy
! "clicked" is a GtkButton signal
function hello (widget, gdata ) result(ret) bind(c)
use iso_c_binding, only: c_ptr, c_int
+ !GCC$ ATTRIBUTES DLLEXPORT :: hello
integer(c_int) :: ret
type(c_ptr), value :: widget, gdata
print *, "Hello World!"
@@ -77,6 +80,7 @@ end function hello
function button1clicked (widget, gdata ) result(ret) bind(c)
use iso_c_binding, only: c_ptr, c_int
+ !GCC$ ATTRIBUTES DLLEXPORT :: button1clicked
integer(c_int) :: ret
type(c_ptr), value :: widget, gdata
print *, "Button 1 clicked!"
@@ -85,6 +89,7 @@ end function button1clicked
function button2clicked (widget, gdata ) result(ret) bind(c)
use iso_c_binding, only: c_ptr, c_int
+ !GCC$ ATTRIBUTES DLLEXPORT :: button2clicked
integer(c_int) :: ret
type(c_ptr), value :: widget, gdata
print *, "Button 2 clicked!"
View
@@ -31,9 +31,9 @@ module handlers
use gtk, only: gtk_button_new, gtk_container_add, gtk_main, gtk_main_quit, gtk_&
&text_view_new, gtk_widget_set_sensitive, gtk_widget_show, gtk_widget_show_all,&
- & gtk_window_new, gtk_init, gtk_file_chooser_get_filename, TRUE, FALSE
+ & gtk_window_new, gtk_init, TRUE, FALSE
- use g, only: alloca
+ use gtk_os_dependent, only: gtk_file_chooser_get_filename
implicit none
View
@@ -29,11 +29,12 @@
module handlers
use gtk, only: gtk_action_group_add_action, gtk_action_group_get_action, gtk_ac&
&tion_group_new, gtk_action_new, gtk_box_pack_start, gtk_container_add, gtk_mai&
- &n, gtk_main_quit, gtk_ui_manager_add_ui, gtk_ui_manager_add_ui_from_file, gtk_&
+ &n, gtk_main_quit, gtk_ui_manager_add_ui, gtk_&
&ui_manager_add_ui_from_string, gtk_ui_manager_get_widget, gtk_ui_manager_inser&
&t_action_group, gtk_ui_manager_new, gtk_vbox_new, gtk_widget_set_size_request,&
& gtk_widget_show, gtk_widget_show_all, gtk_window_new, gtk_window_set_title,&
&gtk_init, g_signal_connect, FALSE, TRUE, c_null_ptr, c_null_char, GTK_WINDOW_TOPLEVEL
+ use gtk_os_dependent, only: gtk_ui_manager_add_ui_from_file
implicit none
contains
View
@@ -21,7 +21,7 @@
# If not, see <http://www.gnu.org/licenses/>.
#
# Contributed by Kyle Horne: 05.11.2011
-# Last modifications: James Tappin: 08.17.2012
+# Last modifications: Jens Hunger: 03/05/2013
# CMAKE build file for GtkFortran
@@ -51,9 +51,18 @@ set(sources
"gtk-sup.f90"
"gdk-pixbuf-hl.f90"
"pango-auto.f90"
- "gdk-pixbuf-hl.f90"
"gdkevents-auto2.f90")
+if (CMAKE_HOST_WIN32)
+ set(sources
+ ${sources}
+ "mswindowsonly-auto.f90")
+else()
+ set(sources
+ ${sources}
+ "unixonly-auto.f90")
+endif()
+
include_directories("/usr/include")
include_directories(${GTK_INCLUDES})
include_directories("/usr/local/include")
@@ -85,32 +94,50 @@ add_custom_command(
add_custom_target(pkgconfig ALL DEPENDS "gtk-2-fortran.pc")
# The USE generator system.
-add_custom_command(
- OUTPUT gtk-2-fortran-modscan
- COMMAND sed -e s+@PREFIX@+${CMAKE_INSTALL_PREFIX}+ -e s/@GTK@/2/ -e s+@SHARE@+${CMAKE_INSTALL_DATAROOTDIR}+ ${CMAKE_CURRENT_SOURCE_DIR}/usemodules.pl > ${CMAKE_CURRENT_BINARY_DIR}/gtk-2-fortran-modscan
- COMMAND chmod a+x ${CMAKE_CURRENT_BINARY_DIR}/gtk-2-fortran-modscan
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/usemodules.pl
-)
-add_custom_command(
- OUTPUT gtk-2-fortran-index.csv
- COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/gtk-fortran-index.csv ${CMAKE_CURRENT_BINARY_DIR}/gtk-2-fortran-index.csv
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gtk-fortran-index.csv
-)
-add_custom_command(
- OUTPUT gtk-2-enumerators.lis
- COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/gtk-enumerators.lis ${CMAKE_CURRENT_BINARY_DIR}/gtk-2-enumerators.lis
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gtk-enumerators.lis
-)
+if (CMAKE_HOST_WIN32)
+ add_custom_command(
+ OUTPUT gtk-2-fortran-modscan
+ COMMAND sed -e s+@PREFIX@+${CMAKE_INSTALL_PREFIX}+ -e s/@GTK@/2/ -e s+@SHARE@+${CMAKE_INSTALL_DATAROOTDIR}+ ${CMAKE_CURRENT_SOURCE_DIR}/usemodules.pl > ${CMAKE_CURRENT_BINARY_DIR}/gtk-2-fortran-modscan
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/usemodules.pl
+ )
+ add_custom_command(
+ OUTPUT gtk-2-fortran-index.csv
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/gtk-fortran-index.csv ${CMAKE_CURRENT_BINARY_DIR}/gtk-2-fortran-index.csv
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gtk-fortran-index.csv
+ )
+ add_custom_command(
+ OUTPUT gtk-2-enumerators.lis
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/gtk-enumerators.lis ${CMAKE_CURRENT_BINARY_DIR}/gtk-2-enumerators.lis
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gtk-enumerators.lis
+ )
+else()
+ add_custom_command(
+ OUTPUT gtk-2-fortran-modscan
+ COMMAND sed -e s+@PREFIX@+${CMAKE_INSTALL_PREFIX}+ -e s/@GTK@/2/ -e s+@SHARE@+${CMAKE_INSTALL_DATAROOTDIR}+ ${CMAKE_CURRENT_SOURCE_DIR}/usemodules.pl > ${CMAKE_CURRENT_BINARY_DIR}/gtk-2-fortran-modscan
+ COMMAND chmod a+x ${CMAKE_CURRENT_BINARY_DIR}/gtk-2-fortran-modscan
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/usemodules.pl
+ )
+ add_custom_command(
+ OUTPUT gtk-2-fortran-index.csv
+ COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/gtk-fortran-index.csv ${CMAKE_CURRENT_BINARY_DIR}/gtk-2-fortran-index.csv
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gtk-fortran-index.csv
+ )
+ add_custom_command(
+ OUTPUT gtk-2-enumerators.lis
+ COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/gtk-enumerators.lis ${CMAKE_CURRENT_BINARY_DIR}/gtk-2-enumerators.lis
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gtk-enumerators.lis
+ )
+endif()
add_custom_target(usemodules ALL DEPENDS gtk-2-fortran-modscan
gtk-2-fortran-index.csv gtk-2-enumerators.lis)
# Man page(s)
-add_custom_command(
- OUTPUT gtk-2-fortran-modscan.1
- COMMAND sed -e s/@GTK@/2/ ${CMAKE_CURRENT_SOURCE_DIR}/gtk-fortran-modscan.man > ${CMAKE_CURRENT_BINARY_DIR}/gtk-2-fortran-modscan.1
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gtk-fortran-modscan.man
-)
+ add_custom_command(
+ OUTPUT gtk-2-fortran-modscan.1
+ COMMAND sed -e s/@GTK@/2/ ${CMAKE_CURRENT_SOURCE_DIR}/gtk-fortran-modscan.man > ${CMAKE_CURRENT_BINARY_DIR}/gtk-2-fortran-modscan.1
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gtk-fortran-modscan.man
+ )
add_custom_target(manpage ALL DEPENDS gtk-2-fortran-modscan.1)
@@ -151,9 +178,9 @@ install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/gtk_draw_hl.mod"
"${CMAKE_CURRENT_BINARY_DIR}/gdk_pixbuf_hl.mod"
"${CMAKE_CURRENT_BINARY_DIR}/gtk_sup.mod"
- "${CMAKE_CURRENT_BINARY_DIR}/gdk_pixbuf_hl.mod"
"${CMAKE_CURRENT_BINARY_DIR}/pango.mod"
"${CMAKE_CURRENT_BINARY_DIR}/gdk_events.mod"
+ "${CMAKE_CURRENT_BINARY_DIR}/gtk_os_dependent.mod"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtk-2-fortran)
install(PROGRAMS
Oops, something went wrong.

0 comments on commit a17736b

Please sign in to comment.