From 768bb7327b161e7e3f3d7a6d0a973ea97b60f1f4 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Mon, 20 Oct 2025 08:33:21 +0000 Subject: [PATCH] add version header git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@428 b9cfdab3-6d41-4d17-bbe4-086880011989 --- README.txt | 2 +- include/Mw/Milsko.h | 1 + include/Mw/Version.h | 24 ++++++++++++++++++++++++ src/backend/x11.c | 12 ++++++------ tools/doxyfilter.pl | 12 ++++++------ tools/readme.pl | 11 ++++++++++- 6 files changed, 48 insertions(+), 14 deletions(-) create mode 100644 include/Mw/Version.h diff --git a/README.txt b/README.txt index c03cc13..0184745 100644 --- a/README.txt +++ b/README.txt @@ -1,5 +1,5 @@ -Greetings - Welcome to the Milsko GUI Toolkit (Version 1.0) +Greetings - Welcome to the Milsko GUI Toolkit (Version pre-1.0) This document contains a brief summary of the contents of this source distributions and building instructions for Milsko GUI Toolkit. diff --git a/include/Mw/Milsko.h b/include/Mw/Milsko.h index b978d01..99262ad 100644 --- a/include/Mw/Milsko.h +++ b/include/Mw/Milsko.h @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff --git a/include/Mw/Version.h b/include/Mw/Version.h new file mode 100644 index 0000000..2e2d388 --- /dev/null +++ b/include/Mw/Version.h @@ -0,0 +1,24 @@ +/* $Id$ */ +/*! + * %file Mw/Version.h + * %brief Version informations + */ +#ifndef __MW_VERSION_H__ +#define __MW_VERSION_H__ + +/*! + * %brief Major version + */ +#define MwMAJOR 0 + +/*! + * %brief Minor version + */ +#define MwMINOR 0 + +/*! + * %brief Version in string + */ +#define MwVERSION "pre-1.0" + +#endif diff --git a/src/backend/x11.c b/src/backend/x11.c index 88f93c9..bef0372 100644 --- a/src/backend/x11.c +++ b/src/backend/x11.c @@ -40,19 +40,19 @@ static void destroy_pixmap(MwLL handle) { XFreePixmap(handle->display, handle->pixmap); } -static void wait_map(MwLL handle){ +static void wait_map(MwLL handle) { XEvent* queue = NULL; - XEvent ev; - while(1){ + XEvent ev; + while(1) { XNextEvent(handle->display, &ev); - if(ev.type == MapNotify && ev.xmap.window == handle->window){ + if(ev.type == MapNotify && ev.xmap.window == handle->window) { break; - }else{ + } else { arrput(queue, ev); } } - while(arrlen(queue) > 0){ + while(arrlen(queue) > 0) { XPutBackEvent(handle->display, &queue[0]); arrdel(queue, 0); } diff --git a/tools/doxyfilter.pl b/tools/doxyfilter.pl index ffdbe3a..989bfd0 100755 --- a/tools/doxyfilter.pl +++ b/tools/doxyfilter.pl @@ -2,11 +2,11 @@ # $Id$ open(IN, "<", $ARGV[0]); -while(my $l = ){ - $l =~ s/\r?\n$//g; - $l =~ s/%([^ ]+)/@\1/g; - if(!($l =~ /\@prop /)){ - print("$l\n"); - } +while (my $l = ) { + $l =~ s/\r?\n$//g; + $l =~ s/%([^ ]+)/@\1/g; + if (!($l =~ /\@prop /)) { + print("$l\n"); + } } close(IN); diff --git a/tools/readme.pl b/tools/readme.pl index 2a1cc0c..3d2986f 100755 --- a/tools/readme.pl +++ b/tools/readme.pl @@ -39,10 +39,19 @@ sub h { print(OUT "\n"); } +open(IN, "<", "include/Mw/Version.h"); +my @lines = ; +close(IN); +my @match = grep(/MwVERSION/, @lines); + +my $ver = $match[0]; +$ver =~ /\"([^"]+)\"/; +$ver = $1; + open(OUT, ">", "README.txt"); l(""); -l("Greetings - Welcome to the Milsko GUI Toolkit (Version 1.0)"); +l("Greetings - Welcome to the Milsko GUI Toolkit (Version " . $ver . ")"); l(""); l( " This document contains a brief summary of the contents of this source distributions and building instructions for Milsko GUI Toolkit."