Skip to content

Commit

Permalink
Merge pull request #2 from Oszimilian/CleanUp_01
Browse files Browse the repository at this point in the history
Clean up 01
  • Loading branch information
Oszimilian authored Jul 29, 2022
2 parents c24ef8b + d6512e6 commit 7173262
Show file tree
Hide file tree
Showing 35 changed files with 929 additions and 243 deletions.
4 changes: 3 additions & 1 deletion .vscode/configurationCache.log

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions .vscode/dryrun.log
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ gcc -Wall -g -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/inclu
gcc -Wall -g -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c Background.c
gcc -Wall -g -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c GUI.c
gcc -Wall -g -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c PDF.c
gcc -Wall -g -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c Worksheed_Adjust.c
gcc -Wall -g -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c PNG.c
gcc -Wall -g -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c Worksheet_Creat.c
gcc -Wall -g -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c GUI_Call.c
gcc -Wall -g -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c Worksheet_Status.c
gcc -Wall -g -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c GUI_Status.c
gcc -Wall -g -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c GUI_Update.c
gcc -o prog main.o Background.o GUI.o PDF.o Worksheed_Adjust.o Worksheet_Creat.o GUI_Call.o Worksheet_Status.o GUI_Status.o GUI_Update.o -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -export-dynamic /usr/local/lib/libhpdf.a -lz -lm -lpthread

gcc -o prog main.o Background.o GUI.o PDF.o PNG.o Worksheet_Creat.o GUI_Call.o Worksheet_Status.o GUI_Status.o GUI_Update.o -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -export-dynamic /usr/local/lib/libhpdf.a -lz -lm -lpthread

make: Leaving directory '/home/maximilian/NewGit/WCO'

9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@
"stdio.h": "c",
"setjmp.h": "c",
"stdlib.h": "c"
}
},
"makefile.launchConfigurations": [
{
"cwd": "/home/maximilian/TestGit/WCO",
"binaryPath": "/home/maximilian/TestGit/WCO/prog",
"binaryArgs": []
}
]
}
69 changes: 42 additions & 27 deletions .vscode/targets.log
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
make all --print-data-base --no-builtin-variables --no-builtin-rules --question
make: *** No rule to make target 'all'. Stop.

# GNU Make 4.2.1
# Built for x86_64-pc-linux-gnu
# Copyright (C) 1988-2016 Free Software Foundation, Inc.
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
# This is free software: you are free to change and redistribute it.
# There is NO WARRANTY, to the extent permitted by law.

# Make data base, printed on Mon Jul 25 18:21:56 2022

# Make data base, printed on Fri Jul 29 22:02:34 2022


# Variables

Expand Down Expand Up @@ -49,15 +49,19 @@ VSCODE_CWD = /mnt/c/Program Files/Microsoft VS Code
# default
MAKE_HOST := x86_64-pc-linux-gnu
# environment
PATH = /root/.vscode-server/bin/3b889b090b5ad5793f524b5d1d39fda662b96a2a/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/PuTTY/:/mnt/c/Program Files/Microsoft VS Code/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/maximilian/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/maximilian/AppData/Local/GitHubDesktop/bin:/snap/bin

PATH = /root/.vscode-server/bin/3b889b090b5ad5793f524b5d1d39fda662b96a2a/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/PuTTY/:/mnt/c/Program Files/Microsoft VS Code/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/maximilian/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/maximilian/AppData/Local/GitHubDesktop/bin:/mnt/c/Users/maximilian/AppData/Local/atom/bin:/snap/bin

# makefile (from 'makefile', line 4)
KP1 = -Wall -g $(LiberyLink) $(HeaderDir)
# environment
XDG_RUNTIME_DIR = /mnt/wslg/runtime-dir
# environment
ELECTRON_RUN_AS_NODE = 1
# environment
VSCODE_IPC_HOOK_CLI = /mnt/wslg/runtime-dir/vscode-ipc-74815126-a7f5-46cc-85a5-0ec7948b9e40.sock

VSCODE_IPC_HOOK_CLI = /mnt/wslg/runtime-dir/vscode-ipc-73a4fd10-a651-4a46-8309-55790b65579a.sock

# default
.FEATURES := target-specific order-only second-expansion else-if shortest-stem undefine oneshell archives jobserver output-sync check-symlink load
# environment
Expand All @@ -71,15 +75,17 @@ PWD = /home/maximilian/NewGit/WCO
# default
.LOADED :=
# environment
WSL_INTEROP = /run/WSL/14181_interop

WSL_INTEROP = /run/WSL/38_interop

# environment
PULSE_SERVER = /mnt/wslg/PulseServer
# environment
VSCODE_AMD_ENTRYPOINT = vs/workbench/api/node/extensionHostProcess
# environment
HOME = /root
# makefile (from 'makefile', line 2)
ObjectFiles = main.o Background.o GUI.o PDF.o Worksheed_Adjust.o Worksheet_Creat.o GUI_Call.o Worksheet_Status.o GUI_Status.o GUI_Update.o
ObjectFiles = main.o Background.o GUI.o PDF.o PNG.o Worksheet_Creat.o GUI_Call.o Worksheet_Status.o GUI_Status.o GUI_Update.o
# environment
LESSCLOSE = /usr/bin/lesspipe %s %s
# environment
Expand Down Expand Up @@ -165,9 +171,11 @@ WSL_DISTRO_NAME = Ubuntu_WorksheetEnv

# Directories

# . (device 2080, inode 112845): 23 files, no impossibilities.

# 23 files, no impossibilities in 1 directories.
# . (device 2080, inode 110244): 25 files, no impossibilities.


# 25 files, no impossibilities in 1 directories.

# Implicit Rules

Expand Down Expand Up @@ -208,28 +216,29 @@ GUI.c:
# File has not been updated.

# Not a target:
Background.c:
PNG.c:
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.

# Not a target:
GUI_Update.c:
Background.c:
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.

Worksheed_Adjust.o: Worksheed_Adjust.c
# Not a target:
GUI_Update.c:
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
# recipe to execute (from 'makefile', line 26):
gcc $(KP) -c Worksheed_Adjust.c

# Not a target:
makefile:
# Implicit rule search has been done.
# Last modified 2022-07-25 18:21:48.481498937

# Last modified 2022-07-29 15:03:35.941155973

# File has been updated.
# Successfully updated.

Expand All @@ -240,7 +249,7 @@ Worksheet_Creat.o: Worksheet_Creat.c
# recipe to execute (from 'makefile', line 29):
gcc $(KP) -c Worksheet_Creat.c

prog: main.o Background.o GUI.o PDF.o Worksheed_Adjust.o Worksheet_Creat.o GUI_Call.o Worksheet_Status.o GUI_Status.o GUI_Update.o
prog: main.o Background.o GUI.o PDF.o PNG.o Worksheet_Creat.o GUI_Call.o Worksheet_Status.o GUI_Status.o GUI_Update.o
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
Expand Down Expand Up @@ -278,13 +287,10 @@ clean:
# Modification time never checked.
# File has not been updated.
# recipe to execute (from 'makefile', line 41):
rm *.o

make: *** No rule to make target 'all'. Stop.

# Not a target:
Worksheed_Adjust.c:
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
rm *.o

GUI_Call.o: GUI_Call.c
# Implicit rule search has not been done.
Expand Down Expand Up @@ -320,6 +326,13 @@ GUI.o: GUI.c
# recipe to execute (from 'makefile', line 17):
gcc $(KP) -c GUI.c

PNG.o: PNG.c
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
# recipe to execute (from 'makefile', line 26):
gcc $(KP) -c PNG.c

# Not a target:
PDF.c:
# Implicit rule search has not been done.
Expand Down Expand Up @@ -348,12 +361,14 @@ GUI_Update.o: GUI_Update.c

# No general ('VPATH' variable) search path.

# strcache buffers: 1 (0) / strings = 39 / storage = 407 B / avg = 10 B
# current buf: size = 8162 B / used = 407 B / count = 39 / avg = 10 B
# strcache buffers: 1 (0) / strings = 41 / storage = 392 B / avg = 9 B
# current buf: size = 8162 B / used = 392 B / count = 41 / avg = 9 B

# strcache performance: lookups = 76 / hit rate = 48%
# strcache performance: lookups = 78 / hit rate = 47%
# hash-table stats:
# Load=39/8192=0%, Rehash=0, Collisions=1/76=1%
# Finished Make data base on Mon Jul 25 18:21:56 2022

# Load=41/8192=1%, Rehash=0, Collisions=1/78=1%
# Finished Make data base on Fri Jul 29 22:02:34 2022



Binary file added Bild/Solution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Bild/Task.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Bild/sample1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 75 additions & 6 deletions GUI.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,25 @@
#include "GUI.h"
#include "PDF.h"
#include "Worksheet.h"
#include "PNG.h"



/*
* This function is responsible for initializing the gtk widgets and for starting the gtk main loop
*/
void WCO_GUI_Start()
{
//Init the gtk. It is posible to give the arguments from the main function into this init function
gtk_init(NULL, NULL);

//Set up the gtk builder from the glade xml file
MyGUI.MyBuilder = gtk_builder_new_from_file("MyApp.glade");

//Set up the gtk widgets with the gtk builder
MyGUI.MyWindow1 = GTK_WIDGET(gtk_builder_get_object(MyGUI.MyBuilder, "MyWindow"));
MyGUI.MyFixed1 = GTK_WIDGET(gtk_builder_get_object(MyGUI.MyBuilder, "MyFixed1"));
MyGUI.MyWorksheetFixed[0] = GTK_WIDGET(gtk_builder_get_object(MyGUI.MyBuilder, "MyFixed2"));
MyGUI.MyWorksheetFixed[1] = GTK_WIDGET(gtk_builder_get_object(MyGUI.MyBuilder, "MyFixed3"));
MyGUI.MyLabel1 = GTK_LABEL(gtk_builder_get_object(MyGUI.MyBuilder, "MyLabel1"));
MyGUI.MyLabel2 = GTK_LABEL(gtk_builder_get_object(MyGUI.MyBuilder, "MyLabel2"));
MyGUI.MyLabel3 = GTK_LABEL(gtk_builder_get_object(MyGUI.MyBuilder, "MyLabel3"));
Expand Down Expand Up @@ -57,43 +65,73 @@ void WCO_GUI_Start()
MyGUI.MySpinButton13 = GTK_WIDGET(gtk_builder_get_object(MyGUI.MyBuilder, "MySpinButton13"));
MyGUI.MyFileChosserButton1 = GTK_WIDGET(gtk_builder_get_object(MyGUI.MyBuilder, "MyFileChosserButton1"));
MyGUI.MyEntry1 = GTK_WIDGET(gtk_builder_get_object(MyGUI.MyBuilder, "MyEntry1"));




//connecting the signalls which were initilized by glade with the programm
gtk_builder_connect_signals(MyGUI.MyBuilder, NULL);

//show the widgets in the window
gtk_widget_show(MyGUI.MyWindow1);

//WCO_GUI_Init();
//init the gui
WCO_GUI_Init();

//starts the main loop.
//to interrupt this main loop to carry out other functions is not possible. This functions have to be set up in a seperate thread
//but be carefull. GTK is not really thread save.
gtk_main();
}


/*
* This function is used to initialize the GUI struct
*/
void WCO_GUI_Init()
{
//diffrent flags are set;
MyGUI.showPDF = _OFF;
MyGUI.savePDF = _OFF;
MyGUI.saveFolder = _OFF;
MyGUI.showPNG = _OFF;

//the label pointer is now set to the adress of the heap
MyGUI.label = malloc(3 * sizeof(char));

//Every adress of the first "Spallte" gets now a additional adress in the heap for the two dimensional array
for (int i = 0; i <= 2; i++)
{
MyGUI.label[i] = malloc(2 * sizeof(char));
}

//filling the two dimensional array with values which were used to display different label outputs
sprintf(MyGUI.label[0], "Z");
sprintf(MyGUI.label[1], "R");
sprintf(MyGUI.label[2], " ");
//Update the gui conditions
WCO_GUI_Update_Addition();
WCO_GUI_Update_Division();
WCO_GUI_Update_Multiplication();
WCO_GUI_Update_Division();
WCO_GUI_Update_PermissionButton1();

}


/**********************************************************************************************************************/

/*
* Called by press the X-Button in the right uppor corner
* Called by pressing the X-Button or the close button
* Closes the PDF-Viewer and the GTK Window
*/
void exitApp()
{
//Closes the PDFViewer
WCO_GUI_Close_PDFViewer();

//quites from the gtk main loop
gtk_main_quit();

//stops the programm
exit(0);
}

Expand All @@ -111,15 +149,18 @@ void WCO_GUI_Start_PDFViewer()
*/
void WCO_GUI_Close_PDFViewer()
{
// disables the pdf show flag which stopps the loop in which a threads whait to display the pdf-viewer
MyGUI.showPDF = _OFF;

//closes okular via a system command
system("killall okular");
}

/*
* Return the status of the viewer
* Is it on or off
*/
int WCO_GUI_Status_PDFViewer()
int WCO_GUI_Status_Get_PDFViewer()
{
return MyGUI.showPDF;
}
Expand Down Expand Up @@ -172,6 +213,34 @@ void *WCO_GUI_PDFViewer()
}
}

/**********************************************************************************************************************/
/*
* function is responsible to display the created pdf in the gtk window as an png
*/
void WCO_GUI_Show_Worksheet(int page)
{
//this case is true if this generated pdf was the first one since starting the programm
//this is necesserly because at the beginning the gtk-image is not initiliced
if (WCO_GUI_Status_Get_ShowPNG())
{
//this removes the container in which the image is conatained
//if this is not done the displayed pages lie on top of each other
gtk_container_remove(GTK_CONTAINER(MyGUI.MyWorksheetFixed[page]), MyGUI.MyWorksheetImage[page]);
}

//Initializing a new gtk image from a given file
MyGUI.MyWorksheetImage[page] = gtk_image_new_from_file(WCO_PNG_Get_FileName(page));

//add the image to a new container
gtk_container_add(GTK_CONTAINER(MyGUI.MyWorksheetFixed[page]), MyGUI.MyWorksheetImage[page]);

//display the image
gtk_widget_show(MyGUI.MyWorksheetImage[page]);

//move the image to the left upor corner of the container
gtk_fixed_move(GTK_FIXED(MyGUI.MyWorksheetFixed[page]), MyGUI.MyWorksheetImage[page], 0, 0);
}




Expand Down
Loading

0 comments on commit 7173262

Please sign in to comment.