summaryrefslogtreecommitdiff
path: root/ldmicro
diff options
context:
space:
mode:
authorakshay-c2018-11-27 10:18:44 +0530
committerakshay-c2018-11-27 10:18:44 +0530
commit657a206711c4f262b4445767402c3db545b60a69 (patch)
tree60c23ad9f581dfd8a35d2116f20cc78e800989c0 /ldmicro
parentdec9dccf6516fab2c239f9479cb2cc9e002ce6a9 (diff)
downloadLDMicroGtk-657a206711c4f262b4445767402c3db545b60a69.tar.gz
LDMicroGtk-657a206711c4f262b4445767402c3db545b60a69.tar.bz2
LDMicroGtk-657a206711c4f262b4445767402c3db545b60a69.zip
Packaging with inline icon
Diffstat (limited to 'ldmicro')
-rw-r--r--ldmicro/CMakeLists.txt28
-rwxr-xr-xldmicro/LDMicro.desktop9
-rw-r--r--ldmicro/includes/ldmicroVC.h4
-rw-r--r--ldmicro/ldmicro.cpp11
4 files changed, 42 insertions, 10 deletions
diff --git a/ldmicro/CMakeLists.txt b/ldmicro/CMakeLists.txt
index 8175484..140e94b 100644
--- a/ldmicro/CMakeLists.txt
+++ b/ldmicro/CMakeLists.txt
@@ -67,14 +67,21 @@ IF(UNIX)
COMMAND perl txt2c.pl > ${OBJDIR}/helptext.cpp
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/manual*.txt")
+ add_custom_command(
+ OUTPUT ldlogo.h
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/includes
+ COMMAND gdk-pixbuf-csource --raw --name=LD_LOGO ${CMAKE_CURRENT_SOURCE_DIR}/ldmicro.ico > ldlogo.h
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/ldmicro.ico")
+
set(SCRIPT_GENERATED_FILES ${OBJDIR}/helptext.cpp
- ${OBJDIR}/lang-tables.h)
+ ${OBJDIR}/lang-tables.h
+ ldlogo.h)
add_custom_target(LDMicro_SCRIPT_GENERATED_FILES DEPENDS ${SCRIPT_GENERATED_FILES})
## Version control
- set (LDMicro_VERSION_MAJOR 1)
- set (LDMicro_VERSION_MINOR 0)
+ set (LDMicro_VERSION_MAJOR 2)
+ set (LDMicro_VERSION_MINOR 2)
## configure a header file to pass some of the CMake settings
## to the source code
@@ -143,6 +150,21 @@ IF(UNIX)
target_link_libraries (LDMicro LinuxUI)
target_link_libraries (LDMicro FreezeLD)
+ INSTALL(TARGETS LDMicro DESTINATION /usr/local/bin/ldmicro)
+ INSTALL(FILES ldmicro.ico DESTINATION /usr/local/bin/ldmicro)
+ INSTALL(FILES LDMicro.desktop DESTINATION /usr/share/applications)
+
+ ##Debian package creation
+ set(CPACK_GENERATOR "DEB")
+ set(CPACK_PACKAGE_VERSION_MAJOR "2")
+ set(CPACK_PACKAGE_VERSION_MINOR "2")
+ set(CPACK_PACKAGE_VERSION_PATCH "0")
+ set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
+ set(CPACK_PACKAGE_DESCRIPTION "Ladder Logic editor, simulator and compiler for 8 bit microcontrollers")
+ set(CPACK_PACKAGE_CONTACT "Akshay Chipkar akshaychipkar@yahoo.co.in")
+ set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/Debian/postinst")
+
+ include(CPack)
## Add tests
MESSAGE( STATUS "Adding tests.." )
add_custom_command(
diff --git a/ldmicro/LDMicro.desktop b/ldmicro/LDMicro.desktop
new file mode 100755
index 0000000..3d93818
--- /dev/null
+++ b/ldmicro/LDMicro.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Terminal=false
+Icon[en_IN]=/usr/local/bin/ldmicro/ldmicro.ico
+Name[en_IN]=LDMicro
+Exec=/usr/local/bin/ldmicro/LDMicro
+Name=LDMicro
+Icon=/usr/local/bin/ldmicro/ldmicro.ico
diff --git a/ldmicro/includes/ldmicroVC.h b/ldmicro/includes/ldmicroVC.h
index 400bc42..67e0d9c 100644
--- a/ldmicro/includes/ldmicroVC.h
+++ b/ldmicro/includes/ldmicroVC.h
@@ -1,3 +1,3 @@
/// version control
-#define LDMicro_VERSION_MAJOR 1
-#define LDMicro_VERSION_MINOR 0
+#define LDMicro_VERSION_MAJOR 2
+#define LDMicro_VERSION_MINOR 2
diff --git a/ldmicro/ldmicro.cpp b/ldmicro/ldmicro.cpp
index c41862c..1e8c93d 100644
--- a/ldmicro/ldmicro.cpp
+++ b/ldmicro/ldmicro.cpp
@@ -25,7 +25,7 @@
// Jonathan Westhues, Oct 2004
//-----------------------------------------------------------------------------
#include "linuxUI.h"
-
+#include <ldlogo.h>
#include <stdio.h>
#include <stdlib.h>
#include "ldmicro.h"
@@ -1255,10 +1255,11 @@ int main(int argc, char** argv)
gtk_window_move(GTK_WINDOW(MainWindow), 10, 10);
/*gtk_widget_override_background_color(GTK_WIDGET(MainWindow),
GTK_STATE_FLAG_NORMAL, ((HBRUSH)GetStockObject(BLACK_BRUSH)));*/
- gtk_window_set_default_icon(LoadImage(Instance, LDMICRO_ICON,
- IMAGE_ICON, 32, 32, 0));
- gtk_window_set_icon(GTK_WINDOW(MainWindow), LoadImage(Instance, LDMICRO_ICON,
- IMAGE_ICON, 32, 32, 0));
+ GdkPixbuf* pixbuf = gdk_pixbuf_new_from_inline (-1, LD_LOGO, FALSE, NULL);
+// GtkWidget* logo = gtk_image_new_from_pixbuf(pixbuf);
+
+ gtk_window_set_default_icon(pixbuf);
+ gtk_window_set_icon(GTK_WINDOW(MainWindow), pixbuf);
/// Make main window - end
MakeMainWindowMenus();