Changeset 214
- Timestamp:
- 03/16/08 11:35:07 (5 months ago)
- Files:
-
- GtkRadiant/branches/ZeroRadiant/install/modules (added)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps (added)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/bkgrnd2d_conf.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/bkgrnd2d/bitmaps/bkgrnd2d_conf.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/bkgrnd2d_xy_toggle.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/bkgrnd2d/bitmaps/bkgrnd2d_xy_toggle.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/bkgrnd2d_xz_toggle.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/bkgrnd2d/bitmaps/bkgrnd2d_xz_toggle.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/bkgrnd2d_yz_toggle.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/bkgrnd2d/bitmaps/bkgrnd2d_yz_toggle.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/bobtoolz_caulk.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/bobtoolz/bitmaps/bobtoolz_caulk.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/bobtoolz_cleanup.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/bobtoolz/bitmaps/bobtoolz_cleanup.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/bobtoolz_dropent.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/bobtoolz/bitmaps/bobtoolz_dropent.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/bobtoolz_merge.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/bobtoolz/bitmaps/bobtoolz_merge.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/bobtoolz_poly.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/bobtoolz/bitmaps/bobtoolz_poly.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/bobtoolz_split.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/bobtoolz/bitmaps/bobtoolz_split.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/bobtoolz_trainpathplot.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/bobtoolz/bitmaps/bobtoolz_trainpathplot.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/bobtoolz_treeplanter.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/bobtoolz/bitmaps/bobtoolz_treeplanter.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/bobtoolz_turnedge.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/bobtoolz/bitmaps/bobtoolz_turnedge.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/camera_insp.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/camera/bitmaps/camera_insp.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/model_reload_entity.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/plugins/model/bitmaps/model_reload_entity.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/picomodel.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/plugins/model/bitmaps/picomodel.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/sample.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/plugins/sample/bitmaps/sample.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/ufoai_actorclip.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_actorclip.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/ufoai_level1.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_level1.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/ufoai_level2.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_level2.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/ufoai_level3.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_level3.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/ufoai_level4.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_level4.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/ufoai_level5.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_level5.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/ufoai_level6.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_level6.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/ufoai_level7.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_level7.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/ufoai_level8.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_level8.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/ufoai_nodraw.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_nodraw.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/ufoai_stepon.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_stepon.bmp)
- GtkRadiant/branches/ZeroRadiant/install/modules/bitmaps/ufoai_weaponclip.bmp (moved) (moved from GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_weaponclip.bmp)
- GtkRadiant/branches/ZeroRadiant/plugins/model/plugin.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
GtkRadiant/branches/ZeroRadiant/plugins/model/plugin.cpp
r185 r214 22 22 23 23 #include "plugin.h" 24 25 #if 0 // stop using windowing systems in plugins - put the text in SynapseClient::GetInfo26 // =============================================================================27 // Utility functions28 static void dialog_button_callback (GtkWidget *widget, gpointer data)29 {30 GtkWidget *parent;31 int *loop, *ret;32 33 parent = gtk_widget_get_toplevel (widget);34 loop = (int*)g_object_get_data (G_OBJECT (parent), "loop");35 ret = (int*)g_object_get_data (G_OBJECT (parent), "ret");36 37 *loop = 0;38 *ret = (int)data;39 }40 41 static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data)42 {43 int *loop;44 45 gtk_widget_hide (widget);46 loop = (int*)g_object_get_data (G_OBJECT (widget), "loop");47 *loop = 0;48 49 return TRUE;50 }51 52 int DoAboutBox( GtkWidget *parent )53 {54 GtkWidget *window, *w, *text, *vbox, *hbox, *hbox2, *frame;55 GdkPixmap *pixmap;56 GdkBitmap *mask;57 GtkStyle *style;58 int ret, loop = 1;59 char buf[2048];60 const picoModule_t **modules, *pm;61 62 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);63 gtk_signal_connect (GTK_OBJECT (window), "delete_event",64 GTK_SIGNAL_FUNC (dialog_delete_callback), NULL);65 gtk_signal_connect (GTK_OBJECT (window), "destroy",66 GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL);67 gtk_window_set_title (GTK_WINDOW (window), "About...");68 gtk_container_border_width (GTK_CONTAINER (window), 10);69 g_object_set_data (G_OBJECT (window), "loop", &loop);70 g_object_set_data (G_OBJECT (window), "ret", &ret);71 gtk_widget_realize (window);72 73 if (parent != NULL)74 gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (parent));75 76 vbox = gtk_vbox_new (FALSE, 10);77 gtk_container_add (GTK_CONTAINER (window), vbox);78 gtk_widget_show (vbox);79 80 style = gtk_widget_get_style(window);81 82 hbox2 = gtk_hbox_new (FALSE, 10);83 gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 2);84 gtk_widget_show (hbox2);85 86 frame = gtk_frame_new (NULL);87 gtk_box_pack_start (GTK_BOX (hbox2), frame, FALSE, FALSE, 2);88 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);89 gtk_widget_show (frame);90 91 if( g_FuncTable.m_pfnLoadBitmap( "picomodel.bmp", (void **)&pixmap, (void **)&mask ) ) {92 w = gtk_pixmap_new (pixmap, mask);93 gtk_container_add (GTK_CONTAINER (frame), w);94 gtk_widget_show (w);95 }96 97 w = gtk_label_new ("Model Module v1.0 for GtkRadiant\nby Arnout van Meer (rr2do2@splashdamage.com)\n\nBased on the MD3Model Module by SPoG\nPicoModel Library Copyright (c) 2002, Randy Reddig & seaw0lf" );98 gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 2);99 gtk_label_set_justify (GTK_LABEL (w), GTK_JUSTIFY_LEFT);100 gtk_widget_show (w);101 102 w = gtk_scrolled_window_new(NULL, NULL);103 gtk_box_pack_start(GTK_BOX(vbox), w, TRUE, TRUE, 2);104 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(w), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);105 gtk_widget_show(w);106 107 text = gtk_text_new(NULL, NULL);108 gtk_text_set_editable(GTK_TEXT(text), FALSE);109 gtk_container_add(GTK_CONTAINER(w), text);110 111 strcpy( buf, "#Supported Model Formats:\n" );112 gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL, buf, -1);113 114 for( modules = PicoModuleList( NULL ); *modules != NULL; modules++ )115 {116 pm = *modules;117 118 if( pm == NULL)119 break;120 121 sprintf( buf, "\n%s, version %s, (c) %s", pm->displayName, pm->version, pm->copyright );122 gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL, buf, -1);123 }124 125 gtk_text_set_word_wrap(GTK_TEXT(text), FALSE);126 gtk_widget_show(text);127 128 gtk_text_set_point(GTK_TEXT(text), 0);129 gtk_text_forward_delete(GTK_TEXT(text), 1);130 131 w = gtk_hseparator_new ();132 gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 2);133 gtk_widget_show (w);134 135 hbox = gtk_hbox_new (FALSE, 10);136 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 2);137 gtk_widget_show (hbox);138 139 w = gtk_button_new_with_label ("Ok");140 gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);141 gtk_signal_connect (GTK_OBJECT (w), "clicked",142 GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK));143 GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);144 gtk_widget_grab_default (w);145 gtk_widget_show (w);146 ret = IDOK;147 148 gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER);149 gtk_widget_show (window);150 gtk_grab_add (window);151 152 while (loop)153 gtk_main_iteration ();154 155 gtk_grab_remove (window);156 gtk_widget_destroy (window);157 158 return ret;159 }160 #endif161 24 162 25 // toolbar implementation … … 301 164 302 165 static const char *PLUGIN_NAME = "Model loading module"; 303 static const char *PLUGIN_COMMANDS = " Flush & Reload Models,Flush & Reload Selected";304 static const char *PLUGIN_ABOUT = "Model loading module";166 static const char *PLUGIN_COMMANDS = "About;-;Flush & Reload Models;Flush & Reload Selected"; 167 static const char *PLUGIN_ABOUT = "Model Module v1.0 for GtkRadiant\nby Arnout van Meer (rr2do2@splashdamage.com)\n\nBased on the MD3Model Module by SPoG\nPicoModel Library Copyright (c) 2002, Randy Reddig & seaw0lf"; 305 168 306 169 extern "C" const char* QERPlug_Init (void *hApp, void* pMainWidget) … … 326 189 else if( !strcmp( p, "Flush & Reload Models" ) ) 327 190 DoFlushReloadAll(); 191 else if( !strcmp( p, "About" ) ) 192 g_FuncTable.m_pfnMessageBox(NULL, PLUGIN_ABOUT, "About", MB_OK, NULL); 328 193 } 329 194
