gtk_widget_realize( window );
char buffer[256];
- GtkListStore *listMainTextures = gtk_list_store_new( 1, G_TYPE_STRING );
- GtkListStore *listTrimTextures = gtk_list_store_new( 1, G_TYPE_STRING );
+ ui::ListStore listMainTextures = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
+ ui::ListStore listTrimTextures = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
LoadGList( GetFilename( buffer, "plugins/bt/door-tex.txt" ), listMainTextures );
LoadGList( GetFilename( buffer, "plugins/bt/door-tex-trim.txt" ), listTrimTextures );
return FALSE;
}
-bool LoadGList( char* filename, GtkListStore* loadlist ){
+bool LoadGList( char* filename, ui::ListStore loadlist ){
FILE* eFile = fopen( filename, "r" );
if ( eFile ) {
char buffer[256];
*/
#include <list>
-#include <gtk/gtk.h>
+#include <uilib/uilib.h>
#include "str.h"
typedef struct _GList GList;
bool LoadExclusionList( char* filename, std::list<Str>* exclusionList );
-bool LoadGList( char* filename, GtkListStore* loadlist );
+bool LoadGList( char* filename, ui::ListStore loadlist );
std::set<std::string> ignore;
GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) );
- GtkListStore* list = GTK_LIST_STORE( gtk_tree_view_get_model( view ) );
+ ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( view ) ));
GtkTreeIter iter;
gboolean valid = gtk_tree_model_get_iter_first( GTK_TREE_MODEL( list ), &iter );
const gchar* name = gtk_entry_get_text( edit );
if ( g_utf8_strlen( name, -1 ) > 0 ) {
- GtkListStore* list = GTK_LIST_STORE( gtk_tree_view_get_model( GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) ) ) );
+ ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) ) ) ));
GtkTreeIter iter;
gtk_list_store_append( list, &iter );
gtk_list_store_set( list, &iter, 0, name, -1 );
void OnRemoveMaterial( GtkButton* button, gpointer user_data ){
GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) );
- GtkListStore* list = GTK_LIST_STORE( gtk_tree_view_get_model( view ) );
+ ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( view ) ));
GtkTreeSelection* sel = gtk_tree_view_get_selection( view );
GtkTreeIter iter;
gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( lookup_widget( wnd, "t_materialist" ) ), -1, "", renderer, "text", 0, NULL );
// list store
- GtkListStore* ignorelist = gtk_list_store_new( 1, G_TYPE_STRING );
+ ui::ListStore ignorelist = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
gtk_tree_view_set_model( GTK_TREE_VIEW( lookup_widget( wnd, "t_materialist" ) ), GTK_TREE_MODEL( ignorelist ) );
g_object_unref( ignorelist );
AccelGroup::AccelGroup() : AccelGroup(GTK_ACCEL_GROUP(gtk_accel_group_new()))
{}
+ void IListStore::clear() {
+ gtk_list_store_clear(this);
+ }
+
TreePath::TreePath() : TreePath(gtk_tree_path_new())
{}
WRAP(ListStore, Object, _GtkListStore, (),
,
+ void clear();
);
WRAP(TreeModel, Widget, _GtkTreeModel, (),
void Build_refreshMenu( GtkMenu* menu );
-void BSPCommandList_Construct( GtkListStore* store, Project& project ){
- gtk_list_store_clear( store );
+void BSPCommandList_Construct( ui::ListStore store, Project& project ){
+ store.clear();
for ( Project::iterator i = project.begin(); i != project.end(); ++i )
{
{
public:
Project& m_project;
-GtkListStore* m_store;
+ui::ListStore m_store{nullptr};
bool m_changed;
ProjectList( Project& project ) : m_project( project ), m_changed( false ){
}
Build* g_current_build = 0;
-gboolean project_selection_changed( GtkTreeSelection* selection, GtkListStore* store ){
+gboolean project_selection_changed( GtkTreeSelection* selection, ui::ListStore store ){
Project& project = g_build_project;
gtk_list_store_clear( store );
return FALSE;
}
-gboolean commands_cell_edited( GtkCellRendererText* cell, gchar* path_string, gchar* new_text, GtkListStore* store ){
+gboolean commands_cell_edited( GtkCellRendererText* cell, gchar* path_string, gchar* new_text, ui::ListStore store ){
if ( g_current_build == 0 ) {
return FALSE;
}
return FALSE;
}
-gboolean commands_key_press( ui::Widget widget, GdkEventKey* event, GtkListStore* store ){
+gboolean commands_key_press( ui::Widget widget, GdkEventKey* event, ui::ListStore store ){
if ( g_current_build == 0 ) {
return FALSE;
}
gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( scr ) );
{
- GtkListStore* store = gtk_list_store_new( 1, G_TYPE_STRING );
+ auto store = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
ui::Widget view = ui::TreeView( ui::TreeModel(GTK_TREE_MODEL( store ) ));
gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( scr ) );
{
- GtkListStore* store = gtk_list_store_new( 1, G_TYPE_STRING );
+ ui::ListStore store = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
ui::Widget view = ui::TreeView(ui::TreeModel( GTK_TREE_MODEL( store ) ));
gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( scr ), TRUE, TRUE, 0 );
{
- GtkListStore* store = gtk_list_store_new( 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INT );
+ ui::ListStore store = ui::ListStore(gtk_list_store_new( 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INT ));
ui::Widget view = ui::TreeView(ui::TreeModel(GTK_TREE_MODEL(store)));
dialog.m_list = GTK_TREE_VIEW( view );
class BuildCommandList : public CommandVisitor
{
TextFileOutputStream m_commandList;
- GtkListStore* m_store;
+ ui::ListStore m_store;
public:
- BuildCommandList( const char* filename, GtkListStore* store ) : m_commandList( filename ), m_store( store ){
+ BuildCommandList( const char* filename, ui::ListStore store ) : m_commandList( filename ), m_store( store ){
}
void visit( const char* name, Accelerator& accelerator ){
StringOutputStream modifiers;
GtkEntry* g_entityKeyEntry;
GtkEntry* g_entityValueEntry;
-GtkListStore* g_entlist_store;
-GtkListStore* g_entprops_store;
+ui::ListStore g_entlist_store{nullptr};
+ui::ListStore g_entprops_store{nullptr};
const EntityClass* g_current_flags = 0;
const EntityClass* g_current_comment = 0;
const EntityClass* g_current_attributes = 0;
class EntityClassListStoreAppend : public EntityClassVisitor
{
-GtkListStore* store;
+ui::ListStore store;
public:
-EntityClassListStoreAppend( GtkListStore* store_ ) : store( store_ ){
+EntityClassListStoreAppend( ui::ListStore store_ ) : store( store_ ){
}
void visit( EntityClass* e ){
GtkTreeIter iter;
EntityInspector_updateSpawnflags();
- GtkListStore* store = g_entprops_store;
+ ui::ListStore store = g_entprops_store;
// save current key/val pair around filling epair box
// row_select wipes it and sets to first in list
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
{
- GtkListStore* store = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_POINTER );
+ ui::ListStore store = ui::ListStore(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_POINTER ));
GtkTreeView* view = ui::TreeView( ui::TreeModel( GTK_TREE_MODEL( store ) ));
gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), FALSE );
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
{
- GtkListStore* store = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING );
+ ui::ListStore store = ui::ListStore(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING ));
ui::Widget view = ui::TreeView(ui::TreeModel( GTK_TREE_MODEL( store ) ));
gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), FALSE );
gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
{
- GtkListStore* store = gtk_list_store_new( 1, G_TYPE_STRING );
+ ui::ListStore store = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
ui::Widget view = ui::TreeView(ui::TreeModel( GTK_TREE_MODEL( store ) ));
gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
{
GPtrArray *m_pFeedbackElements;
// the list widget we use in the dialog
-GtkListStore* m_clist;
+ui::ListStore m_clist{nullptr};
ISAXHandler *m_pHighlight;
IGL2DWindow* m_pDraw2D;
public:
ModalDialog dialog;
GtkEntry* brushes_entry;
GtkEntry* entities_entry;
- GtkListStore* EntityBreakdownWalker;
+ ui::ListStore EntityBreakdownWalker{nullptr};
ui::Window window = MainFrame_getWindow().create_dialog_window("Map Info", G_CALLBACK(dialog_delete_callback ), &dialog );
gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( scr ), TRUE, TRUE, 0 );
{
- GtkListStore* store = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING );
+ ui::ListStore store = ui::ListStore(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING ));
ui::Widget view = ui::TreeView(ui::TreeModel( GTK_TREE_MODEL( store ) ));
gtk_tree_view_set_headers_clickable( GTK_TREE_VIEW( view ), TRUE );
template<typename StringList>
class EntryCompletion
{
-GtkListStore* m_store;
+ui::ListStore m_store;
IdleDraw m_idleUpdate;
public:
EntryCompletion() : m_store( 0 ), m_idleUpdate( UpdateCaller( *this ) ){
}
void connect( GtkEntry* entry ){
- if ( m_store == 0 ) {
- m_store = gtk_list_store_new( 1, G_TYPE_STRING );
+ if ( !m_store ) {
+ m_store = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
fill();
ui::Widget m_treeViewTree;
ui::Widget m_treeViewTags;
ui::Widget m_tag_frame;
-GtkListStore* m_assigned_store;
-GtkListStore* m_available_store;
+ui::ListStore m_assigned_store{nullptr};
+ui::ListStore m_available_store{nullptr};
ui::Widget m_assigned_tree;
ui::Widget m_available_tree;
ui::Widget m_scr_win_tree;
ui::Widget m_shader_info_item;
std::set<CopiedString> m_all_tags;
-GtkListStore* m_all_tags_list;
+ui::ListStore m_all_tags_list{nullptr};
std::vector<CopiedString> m_copied_tags;
std::set<CopiedString> m_found_shaders;
N_COLUMNS
};
-void BuildStoreAssignedTags( GtkListStore* store, const char* shader, TextureBrowser* textureBrowser ){
+void BuildStoreAssignedTags( ui::ListStore store, const char* shader, TextureBrowser* textureBrowser ){
GtkTreeIter iter;
gtk_list_store_clear( store );
}
}
-void BuildStoreAvailableTags( GtkListStore* storeAvailable,
- GtkListStore* storeAssigned,
+void BuildStoreAvailableTags( ui::ListStore storeAvailable,
+ ui::ListStore storeAssigned,
const std::set<CopiedString>& allTags,
TextureBrowser* textureBrowser ){
GtkTreeIter iterAssigned;
// tag stuff
if ( g_TextureBrowser.m_tags ) {
{ // fill tag GtkListStore
- g_TextureBrowser.m_all_tags_list = gtk_list_store_new( N_COLUMNS, G_TYPE_STRING );
+ g_TextureBrowser.m_all_tags_list = ui::ListStore(gtk_list_store_new( N_COLUMNS, G_TYPE_STRING ));
GtkTreeSortable* sortable = GTK_TREE_SORTABLE( g_TextureBrowser.m_all_tags_list );
gtk_tree_sortable_set_sort_column_id( sortable, TAG_COLUMN, GTK_SORT_ASCENDING );
gtk_container_set_border_width( GTK_CONTAINER( scrolled_win ), 0 );
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolled_win ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS );
- g_TextureBrowser.m_assigned_store = gtk_list_store_new( N_COLUMNS, G_TYPE_STRING );
+ g_TextureBrowser.m_assigned_store = ui::ListStore(gtk_list_store_new( N_COLUMNS, G_TYPE_STRING ));
GtkTreeSortable* sortable = GTK_TREE_SORTABLE( g_TextureBrowser.m_assigned_store );
gtk_tree_sortable_set_sort_column_id( sortable, TAG_COLUMN, GTK_SORT_ASCENDING );
gtk_container_set_border_width( GTK_CONTAINER( scrolled_win ), 0 );
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolled_win ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS );
- g_TextureBrowser.m_available_store = gtk_list_store_new( N_COLUMNS, G_TYPE_STRING );
+ g_TextureBrowser.m_available_store = ui::ListStore(gtk_list_store_new( N_COLUMNS, G_TYPE_STRING ));
GtkTreeSortable* sortable = GTK_TREE_SORTABLE( g_TextureBrowser.m_available_store );
gtk_tree_sortable_set_sort_column_id( sortable, TAG_COLUMN, GTK_SORT_ASCENDING );