From: TimePath Date: Sat, 22 Jul 2017 06:44:57 +0000 (+1000) Subject: Remove from gtkutil/entry.h X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fff4340802f7ea77fddbb6393bc4fd20ed8752d8;p=xonotic%2Fnetradiant.git Remove from gtkutil/entry.h --- diff --git a/libs/gtkutil/CMakeLists.txt b/libs/gtkutil/CMakeLists.txt index cd947972..0bce430a 100644 --- a/libs/gtkutil/CMakeLists.txt +++ b/libs/gtkutil/CMakeLists.txt @@ -6,7 +6,7 @@ add_library(gtkutil container.h cursor.cpp cursor.h dialog.cpp dialog.h - entry.h + entry.cpp entry.h filechooser.cpp filechooser.h frame.cpp frame.h glfont.cpp glfont.h diff --git a/libs/gtkutil/entry.cpp b/libs/gtkutil/entry.cpp new file mode 100644 index 00000000..acb74db8 --- /dev/null +++ b/libs/gtkutil/entry.cpp @@ -0,0 +1,37 @@ +#include "entry.h" + +#include + +void entry_set_string(ui::Entry entry, const char *string) +{ + gtk_entry_set_text(entry, string); +} + +void entry_set_int(ui::Entry entry, int i) +{ + char buf[32]; + sprintf(buf, "%d", i); + entry_set_string(entry, buf); +} + +void entry_set_float(ui::Entry entry, float f) +{ + char buf[32]; + sprintf(buf, "%g", f); + entry_set_string(entry, buf); +} + +const char *entry_get_string(ui::Entry entry) +{ + return gtk_entry_get_text(entry); +} + +int entry_get_int(ui::Entry entry) +{ + return atoi(entry_get_string(entry)); +} + +double entry_get_float(ui::Entry entry) +{ + return atof(entry_get_string(entry)); +} diff --git a/libs/gtkutil/entry.h b/libs/gtkutil/entry.h index 297072f5..067157af 100644 --- a/libs/gtkutil/entry.h +++ b/libs/gtkutil/entry.h @@ -19,39 +19,21 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #if !defined( INCLUDED_GTKUTIL_ENTRY_H ) #define INCLUDED_GTKUTIL_ENTRY_H -#include -#include -#include - -inline void entry_set_string( ui::Entry entry, const char* string ){ - gtk_entry_set_text( entry, string ); -} - -inline void entry_set_int( ui::Entry entry, int i ){ - char buf[32]; - sprintf( buf, "%d", i ); - entry_set_string( entry, buf ); -} - -inline void entry_set_float( ui::Entry entry, float f ){ - char buf[32]; - sprintf( buf, "%g", f ); - entry_set_string( entry, buf ); -} - -inline const char* entry_get_string( ui::Entry entry ){ - return gtk_entry_get_text( entry ); -} - -inline int entry_get_int( ui::Entry entry ){ - return atoi( entry_get_string( entry ) ); -} - -inline double entry_get_float( ui::Entry entry ){ - return atof( entry_get_string( entry ) ); -} +void entry_set_string(ui::Entry entry, const char *string); + +void entry_set_int(ui::Entry entry, int i); + +void entry_set_float(ui::Entry entry, float f); + +const char *entry_get_string(ui::Entry entry); + +int entry_get_int(ui::Entry entry); + +double entry_get_float(ui::Entry entry); #endif